2 ms·
I think that might work. My method makes more sense to me but that's because it's just the first thing that came to mind when thinking about the problem. Your
by jswinghammer 16y ago
I think that might work. My method makes more sense to me but that's because it's just the first thing that came to mind when thinking about the problem.
Your method means you only need to walk the string once which is better. Either way 9/10 interview candidates can't even get that far.