You are viewing a single comment's thread. Return to all comments →
For the follow input:
1 10 84 87 78 16 94 36 87 93 50 22
My solution ended with Sandy as the winner, but the test indicates that should be Manasa.
Am I missing something?
Here is my log moves, as the test says to be optimized:
Bucket 0 - 84 Removing 13 left : 71 Removing 13 left : 58 Removing 13 left : 45 Removing 13 left : 32 Removing 13 left : 19 Removing 13 left : 6 Removing 5 left : 1 moves: 7 Bucket 1 - 87 Removing 13 left : 74 Removing 13 left : 61 Removing 13 left : 48 Removing 13 left : 35 Removing 13 left : 22 Removing 11 left : 11 Removing 11 left : 0 moves: 7 Bucket 2 - 78 Removing 13 left : 65 Removing 13 left : 52 Removing 13 left : 39 Removing 13 left : 26 Removing 13 left : 13 Removing 13 left : 0 moves: 6 Bucket 3 - 16 Removing 13 left : 3 Removing 3 left : 0 moves: 2 Bucket 4 - 94 Removing 13 left : 81 Removing 13 left : 68 Removing 13 left : 55 Removing 13 left : 42 Removing 13 left : 29 Removing 13 left : 16 Removing 13 left : 3 Removing 3 left : 0 moves: 8 Bucket 5 - 36 Removing 13 left : 23 Removing 11 left : 12 Removing 11 left : 1 moves: 3 Bucket 6 - 87 Removing 13 left : 74 Removing 13 left : 61 Removing 13 left : 48 Removing 13 left : 35 Removing 13 left : 22 Removing 11 left : 11 Removing 11 left : 0 moves: 7 Bucket 7 - 93 Removing 13 left : 80 Removing 13 left : 67 Removing 13 left : 54 Removing 13 left : 41 Removing 13 left : 28 Removing 13 left : 15 Removing 13 left : 2 Removing 2 left : 0 moves: 8 Bucket 8 - 50 Removing 13 left : 37 Removing 13 left : 24 Removing 13 left : 11 Removing 11 left : 0 moves: 4 Bucket 9 - 22 Removing 11 left : 11 Removing 11 left : 0 moves: 2 final Moves: 54
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
The Prime Game
You are viewing a single comment's thread. Return to all comments →
For the follow input:
1 10 84 87 78 16 94 36 87 93 50 22
My solution ended with Sandy as the winner, but the test indicates that should be Manasa.
Am I missing something?
Here is my log moves, as the test says to be optimized: