Accenture OA-22 2024
Problem Description
Two players, A and B, are playing the game of Rock, Paper, Scissors. Player A chooses a move represented by a string value M, which can be one of the following: 'rock', 'paper', or 'scissors'.
The rules of the game are:
- rock beats scissors
- scissors beats paper
- paper beats rock
Your task is to find and return a string value representing the winning move for Player B.
Note: The output is case-sensitive.
Input Format:
- input1: A string value M representing the move chosen by Player A.
Output Format:
Return a string value representing the winning move for Player B.
Constraints:
- The input string M must be one of the following values:
- "rock"
- "paper"
- "scissors"
- The output must be case-sensitive
Example
Sample Input:
M = "rock"
Sample Output:
paper
Explanation:
Since Player A chose "rock", Player B can choose "paper" to win.