Sort 24 Discussions, By:
Please Login in order to post a comment
Here is New Year Game problem solution in Python Java C++ and C programming - https://programs.programmingoneonone.com/2021/07/hackerrank-new-year-game-problem-solution.html
Something is missing from the description.
It talks about making optimal move but each move is to take an integer from the front of array as it moves along.
What do they mean by taking turns? if each must take the first element in the array/queue then how do they make the best choice?
There are no choices, they just get the item in the front of the array.
I really wish they would edit the descriptions better.
here is problem solution in java python c++ and c programming.
Once you recognize the most important invariant, you can see that there's actually only a few truly distinct possible games, and then it's simple to just go through them manually and check who wins each one.
why it has 5 inputs ?
7 6 18
what does other input means I dont understand the use of them.