Answer to Question #53507 in C++ for bara
Start By Considering the base cases:
• First for n=1, Obviously Alice Loses.
• For n = 2,3,4 Alice Wins.
• For n = 5, Bob Wins.
Now for further 3 positions (i.e. 6,7,8), we can make Alice reach Bob's Winning position but starting from Bob ( i.e. (6-1), (7-2), (8-3) ). Then, Bob can only return Alice her winning positions.
• So, Alice Wins for n = 6,7,8.
Similarly for n= 9 Bob Wins. Continuing this reasoning, we can say that for n=1,5,9 i.e for any number of form 4n-3, Bob wins and for the rest, Alice wins.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!