Small changes on your version:
http://codepad.org/E9KHKvAi

It's now on Rosettacode. I have added more changes to make it able to deal with immutable input.

Bye,
bearophile

Reply via email to