Two Pile With Grundy Number
Two players Alice and Bob are playing a game. They have 2 pile's with n1 and n2 coins in it.Input Format
They can pick only allowed numbers of coins from any one pile at a time given in an array picks.
Alice goes first and they take alternate turns.
The player who picks the last coin is the winner. Can you find out the winner.
The first line contains two integers n1 and n2.Output Format
Second line contains size of picks array say l
picks[0]
picks[1]
....
picks[l-1]
Print the winner (ALICE or BOB).Question Video
1 <= n1, n2 <= 50Sample Input
4 3Sample Output
3
1
4
2
ALICE
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run