3 ms·
I like skeeto's version [0], but it allows for unbounded parsing due to unbounded zero padding of decimals, so therefore not constant time. Probably only requir
by commandersaki 10mo ago
I like skeeto's version [0], but it allows for unbounded parsing due to unbounded zero padding of decimals, so therefore not constant time. Probably only requires an additional counter for the number of digits seen to mitigate that, but it would probably yucky the code a bit.
[0]: https://github.com/skeeto/scratch/blob/2af9b076117838b93fc2fddeac423a0ac1985db2/prips/prips.c#L227-L259 https://github.com/skeeto/scratch/blob/2af9b076117838b93fc2f...