3 ms·
try this test case ([5,1,0,1],1)
by huhalu 13y ago
try this test case ([5,1,0,1],1)
- igor47 13y agothanks! i updated the gist (https://gist.github.com/igor47/7228586/revisions https://gist.github.com/igor47/7228586/revisions), but the solution is not nearly as simple as before.
- lelf 13y agoFails for [3,0,1,0,2]
- ledave123 13y agoTry 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