Company: Mercer | Mettl_13oct
Difficulty: medium
Rock Paper Scissors Problem Description James and Lily play a tournament of N matches of Rock, Paper, Scissors. In every match each player shows one hand sign, and points are awarded as follows: Rock beats Scissors. Scissors beats Paper. Paper beats Rock. The winner of a match gets 1 point and the loser gets 0. If both players show the same sign, nobody gets a point. After all N matches, the player with more points wins the tournament. If the totals are equal, nobody wins the tournament, so it does not count as a win for James. James never shows the same hand sign in two consecutive matches. Lily's signs are already known: you are given them as a string of length N made of the characters R , P and S (rock, paper and scissors). Write a function rockPaperScissors(input1, input2) that returns how many different sequences of hand signs James can play (obeying his rule) that make him win the tournament. Two sequences are different if they differ in at least one match. Since the count can be