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 / rahul
N%2
if it gives 0 then the person can choose to go second.if
nonzero then he should go first.But this logic is acceptable
only if there is atleast one egg in each basket.
Is This Answer Correct ? | 2 Yes | 7 No |
Post New Answer View All Answers
Write a simple code fragment that will check if a number is positive or negative.
Differentiate fundamental data types and derived data types in C.
Do pointers store the address of value or the actual value of a variable?
how could explain about job profile
Explain what are the different file extensions involved when programming in c?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply
What are the disadvantages of a shell structure?
What is the difference between malloc() and calloc() function in c language?
What is s in c?
What is the g value paradox?
Explain the difference between call by value and call by reference in c language?
What is new line escape sequence?
Explain the difference between structs and unions in c?
What is the benefit of using const for declaring constants?
What are # preprocessor operator in c?