Hacker News new | ask | show | jobs
by huhalu 4612 days ago
try this test case ([5,1,0,1],1)
2 comments

Try the list(reversed()) of the cases and this finds more bugs:

MISMATCH: [6, 7, 7, 4, 3, 2, 1, 5, 2] holds 10 (got 0) MISMATCH: [5, 3, 6, 7, 7, 4, 3, 2, 1, 5, 2] holds 12 (got 2)

Another mismatch: MISMATCH: [2, 0, 1] holds 1 (got 0) TRUE: [1, 0, 2] holds 1

thanks! i updated the gist (https://gist.github.com/igor47/7228586/revisions), but the solution is not nearly as simple as before.
Fails for [3,0,1,0,2]