4 ms·
I like your solution! Good use of iter(). You actually bring up an interesting question of design philosophies. I thought that the script that I posted was ext
by mudbungie 10y ago
I like your solution! Good use of iter().
You actually bring up an interesting question of design philosophies. I thought that the script that I posted was extremely explicit, and therefore clear. Yours is far more terse, and implicit, which means that there's less to understand, but there is some onus on the reader to decode what is happening.
I'm not sure which is better, as a policy. Obviously, solving problems with fewer lines is desirable, but it's also good to make solutions that are intrinsically obvious.
- kqr 10y agoIt is as they say: every problem can be solved with an additional level of indirection... except the problem of too many levels of indirection.