Earlier quoted context omitted.
* Google asks questions like pots of gold[1] where it's really impossible to solve it on a whiteboard if it's your first time seeing the problem. * Ok, so here is an anecdotal sample. I have not seen this problem before. After reading the problem description I tried one round of the game on the paper (actually in the text editor) to get the feeling of the game play and then it took me about few minutes to come up wit…
Do you allow linear space?
But there is a catch that is very likely not obvious here. All the numbers in the array are (were) unique (and the zero was not present).