Programming Questions



Friday, 25 August 2017

Maximum in every window

A class of N students had written mathematics exam. After few days, mathematics teacher distributes the answer sheet. Suddenly the school principal enters the classroom and there are W chairs in front of the class.

The principal first calls W persons w.r to their registration number. Every student read out their score and principal write the maximum score in the board.
Then the first person left and W + 1 th person  joins with others and read out his score.
Then second person left and W + 2  th person  joins with others and read out his score.
..
It repeats till Nth person joins.
At every stage , principal writes the maximum score in the board.

Example:
N students -- 10
W chairs -- 4
Students score -
32  12  29  21  72  57  52  62  92  12


Output:
The principal had written the below in the board
32  72  72  72  72  92 92  

Home Page


Interview Experience


AVNET

TECH MAHINDRA

AMAZON

VMWARE


Total Page Views


Total Pageviews