Re:Amazon’s Interview Questions And Why I Don’t Work At Amazon
by msandford on Sunday October 20, 2013 @09:01PM
(#6582463)
If there were spaces between the numbers, yeah. Here's the difference:
1 2 3 4 5
12345
At this level it's no big deal. What happens when you get to double digits?
11 12 13
111213
Now what happens when they're not in a nice order?
5121892178
Re:Amazon’s Interview Questions And Why I Don’t Work At Amazon
by andrewcooke on Sunday October 20, 2013 @09:11PM
(#6582519)
oh, good point. thanks (although i think "no spaces" was in there from the start, it wasn't an edit...)
Edit to reflect edit in the parent: The problem as posed is not soluble in general. For k=21,
You can discover the missing digits in linear time, but determining from there whether the input has a unique solution seems a bit annoying.If a valid permutation of the missing digits is missing, you win, but you can have a unique solution without that being the case: