Dragged-out Duel
Time limit1sMemory limit1024 MB
Given two strings of rock-paper-scissors choices over n rounds, output whether you or Guile wins more rounds.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
You and your friend Guile plan to spend an afternoon playing the new Street Fighter game. You both want to start on the left, because you have only practiced your combos from the left. You settle the question with a rock-paper-scissors duel.
The duel is a best-of- match made of single rounds. Whoever wins more rounds starts on the left. If you both pick the same option in a round, that round is not replayed.
Rock beats scissors, scissors beats paper, and paper beats rock. If you both make the same choice, the round is a draw.
Input
The first line contains an integer (), the number of rounds.
The second line contains characters, your choices in each round. The third line contains characters, Guile's choices in each round. Each character is R (rock), P (paper), or S (scissors).
Output
If you win more rounds, output victory. If Guile wins more rounds, output defeat.
It is guaranteed that the two of you never have the same number of wins.