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 / guest
n-1 if n is odd and n+1 if n is even
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Write a code to determine the total number of stops an elevator would take to serve N number of people.
Are c and c++ the same?
Can the size of an array be declared at runtime?
What is an operator?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Explain a pre-processor and its advantages.
What is huge pointer in c?
Is c easier than java?
What is the role of && operator in a program code?
Give the rules for variable declaration?
Why c is known as a mother language?
Explain what is the use of a semicolon (;) at the end of every program statement?
Why & is used in scanf in c?
What are the header files used in c language?
What is a scope resolution operator in c?