3 ms·
I think where you can easily handle the edge cases, as done in the first and third` examples here, it's a good idea, because it's far easier to check correctnes
by ummonk 8y ago
I think where you can easily handle the edge cases, as done in the first and third` examples here, it's a good idea, because it's far easier to check correctness of the algorithm.
In the particular case you mentioned it's perfectly reasonable to explain why the array is getting padded in a code comment.