CHIVOSA - EDITORIAL

Problem

Problem: https://www.codechef.com/problems/CHIVOSA

CODE RUSH 1.0 Contest Link:https://www.codechef.com/CRSH2020

Author: Shivam Kumar
Tester: Krish Murarka
Editorialist: Krish Murarka

DIFFICULTY:

CakeWalk

PREREQUISITES:

NO pre- Requisites for this question :smiley:

PROBLEM:

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.

EXPLANATION:

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 …

Solutions

Setters Solution

Testers Solution