Company: Flipkart DE IIT BHU
Difficulty: medium
Say or Cry Game Problem Description N players are standing in a circle playing a game. The game proceeds in turns numbered 1, 2, 3, ... and so on. In each turn, the current player must say either 'c' or 's' according to the following rule: If the turn number is a multiple of 3 or contains the digit 3 , the player must say 'c'. Otherwise, the player must say 's'. If a player says the wrong thing, they are immediately disqualified and removed from the game. After a player is eliminated, the next turn is taken by the next remaining player in clockwise order. The game continues until only one player remains – the winner . You are given: An integer N – the number of players. A string S , where the i -th character represents what was said on the i -th turn ('c' or 's'). Determine: 1. The order of elimination (the indices of players, 1-based). 2. The winner of the game. Input Format: The first line contains an integer N – number of players. The second line contains a string S , consisting onl