Medium Accuracy: 13.82%
Submissions: 376 Points: 4
Bunty and Dolly are playing a game, described as follows.
There are two boxes having A and B number of chocolates respectively. Both can eat L (L ≥ 1) chocolates from any one box or L chocolates from both the boxes in one move. They play the game alternatively and the last one to eat the chocolate will be the winner.
As Bunty wants to impress Dolly, he wants to make Dolly the winner. You have to help Bunty in deciding who should play first. Assume that both the players play optimally.
A = 1 and B = 2
If Bunty starts first, all the next possible state
(0,2), (1,1), (1,0) are wining state for Dolly
A = 1 and B = 3
You don't need to read input or print anything. Your task is to complete the function solve() which takes the integer A and B as input parameters and returns false if Bunty should play first else returns true.
Expected Time Complexity: O(1) Expected Auxiliary Space: O(1)