There are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?
Answer Posted / lokesh
if the XOR of all the numbers of eggs is zero than second
player win else first player will win.
(From NIM game(game theory))
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How are strings stored in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is meant by realloc()?
How is null defined in c?
What is meant by initialization and how we initialize a variable?
Explain output of printf("Hello World"-'A'+'B'); ?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain high-order bytes.
What does the c in ctime mean?
Explain the difference between ++u and u++?
Is there any data type in c with variable size?
Why is not a pointer null after calling free?
Explain union.