Four coding questions on do-select.
All of them will be difficult.
Time limit is 90 minutes.
You will have to code from scratch.
No boilerplate will be given.
It involves a group of N players (1 ≤ N ≤ 10) forming a circle. One person starts with the phrase, "1 Machi (Fish)". The next person follows with the action, "Paani me gayi (it went into the water)", while the third continues with a clap and shouts, "Chapaak (splash)".
This game is continued with the next two players in the circle restarting with the next number, "2 Machhli". The sequence continues with the next two doing "Paani me gayi", and the following two doing "Chapaak".
This cycle repeats. For example, for "3 Fish", the same phrase will be said by that many players. The catch is that whoever messes up the count is out!
Given an integer P, help the judge of this competition find the phrase which will be spoken by the Pth player and also find who that player will be among all participating friends (N).
Input Format
The first line denotes the number of friends in the group, N. The second line denotes the number of rounds played, M. The subsequent M lines are the values of P for each round.
Constraints
3 ≤ N ≤ 10 1 ≤ M ≤ 10 1 ≤ P ≤ 10%
Output Format
For each round, the output is an integer followed by a case-sensitive string, denoting the player who will speak for the Pth time and what phrase will be spoken.
The following metrics were computed from 2 interview experiences for the PhonePe SDE-intern role in Bengaluru, Karnataka.
PhonePe's interview process for their SDE-intern roles in Bengaluru, Karnataka is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for PhonePe's SDE-intern interview process in Bengaluru, Karnataka.