Opening your workspace…
Workspace/Coding room
Opening your workspace…
Gon calls his move each round: rock, paper, or scissors. Given both move sequences, count how many rounds you win. Rock beats scissors, scissors beats paper, and paper beats rock. A tie is not a win—though Gon may still want a rematch.
["rock","paper","scissors"], ["scissors","rock","paper"]Output3Rock beats scissors, paper beats rock, and scissors beats paper, so you win all three rounds.
["rock","paper","scissors"], ["rock","scissors","rock"]Output0Rock ties rock, paper loses to scissors, and scissors loses to rock.
For each round look up which move your move defeats.
function solve(your_moves, gons_moves) { // Write your solution here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.