> ..."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).
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).