NO pre- Requisites for this question
at time x a boy stands in the i-th position and a girl stands on (i+1)-th position, then at time x+1 the i-th position will have a girl and the (i+1)-th position will have a boy. The time is given in seconds. You’ve got the initial position of the children,
at the initial moment of time. Determine the way the queue is going to look
after t seconds.
IF A BOY is at position a[i] and the girl is adjacent to it i.e. a[i+1] is girl then we need to swap their positions.
Thats it …