3 ms·
For a single pass from left to right, I think you need to maintain a counter for each y-value: http://codepad.org/W16O9vUB http://codepad.org/W16O9vUB I actua
by muxxa 13y ago
For a single pass from left to right, I think you need to maintain a counter for each y-value:
http://codepad.org/W16O9vUB http://codepad.org/W16O9vUB
I actually think this is a good interview question, as playing devils' advocate and coming up with testcases that will break your initial code is a key programming skill, rather than assuming it is done and moving along.