We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
2 of the test cases here are wrong most probably.
for example, for this one below:
1
18
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 5 33 100000
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 33 5 100000
The answer should be First but the expected output is shown as 'Tie' but it is noy possible to be a Tie, because considering A starts the game, both will be at a point after 8 turns each when both will have 800000 as the scores, and then 5 and 33 as the remaining values to choose from, playing optimally, A will choose 33, leaving 5 for B, hence B will loose. So, expected Output should be 'First'.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fun Game
You are viewing a single comment's thread. Return to all comments →
2 of the test cases here are wrong most probably. for example, for this one below: 1 18 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 5 33 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 33 5 100000
The answer should be First but the expected output is shown as 'Tie' but it is noy possible to be a Tie, because considering A starts the game, both will be at a point after 8 turns each when both will have 800000 as the scores, and then 5 and 33 as the remaining values to choose from, playing optimally, A will choose 33, leaving 5 for B, hence B will loose. So, expected Output should be 'First'.