Re:$1000 coding challenge from E la Carte (YC S10)
by anonymoushn on Saturday August 13, 2011 @10:03PM
(#2882537)
That's curious. I initially tried a solution like this and got a result that differed from the expected result by a small amount. I discarded this solution and looked for others when rajatsuri said the first part of q2 assumes that the customer has already picked items that appear to be available.
Edit: By turning the 2 assumptions you mentioned on or off, I am only able to produce answers that are slightly too large or slightly too small. I wonder what the correct question is...
I say "roughly" because they're almost the same order of magnitude, but still off by a few insignificant digits.
I wonder whether that has something to do with either of these assumptions I made:
[3] No two items have the same code.
[4] Five DISTINCT randomly chosen items are "specials" (it is not possible for today's specials to be the first item on the list five times).