3 ms·
seems that most comments here missed the end of the article , where he points to the "production ready" version of the solution, that is indeed very close to th
by bsaul 5y ago
seems that most comments here missed the end of the article , where he points to the "production ready" version of the solution, that is indeed very close to the original one, including a while loop.
- t0astbread 5y agoIt's especially ironic given that this is about a StackOverflow code snippet that many people probably also copied without reading.
- TwoBit 5y agoNeither is production ready because they have no code comments. And if ever there was code requiring comments, this is it.
- zoomablemind 5y ago> ..."production ready" version of the solution, that is indeed very close to the original one, including a while loop. What's missing still is a comprehensive set of test cases to check against. If such cases were spec'ed to go along with the original code, fthen at least one could have seen the applicability range and perhaps other people would have added some challenging corner cases (just as mentioned in the OP).