News for hackers. Stuff that matters.
Re:How to hire a programmer when you're not a programmer by spacemanaki on Tuesday October 26, 2010 @08:28PM (#1836751)
>You work from the 1 position back to the front of the string.

You can work from the front of the string to the end and multiply your accumulated result by 10 at each step, can't you?

I might just be misunderstanding your wording, in which case ignore me.

Re:How to hire a programmer when you're not a programmer by jswinghammer on Tuesday October 26, 2010 @09:57PM (#1836933)
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.