Amazon 2012 Karakoram

It’s kind of fun,

This one was classic question, 2’s complement.

Snip20130318 2

Here we go.

Snip20130318 6

And I failed on Question 2, also classic knapsack problem transform to coins change,

Snip20130318 4

My answer seems correct, but it did not. I didn’t look carefully,

I just missed the line “(you can use as many coins you want)”

Snip20130318 8

The correct answer should be comment out the line #17