3 ms·
I posted this because its an elegant code snippet. Maybe the majority of users here are already familiar with this pattern, but being fairly new to programming
by J3L2404 16y ago
I posted this because its an elegant code snippet. Maybe the majority of users here are already familiar with this pattern, but being fairly new to programming I found it to be a good solution. I read a blogpost by Jake Voytko last year that had a similar goal but cast the strings to integers and was much more complicated. The SO algorithm is probably less efficient depending on the implementation of the subString method, but I imagine it is pretty close to optimal, does anyone know of a better algorithm?