Re:Array Iteration Interview Problem
by azylman on Wednesday August 01, 2012 @09:13PM
(#4326684)
There was only two ways I could think of to do this without the double reverse.
One would introduce more complex branches (looping backwards in CoffeeScript ain't easy) and the other would be using Underscore.js's range function to do the same thing - that solution would be basically identical to this, except without the reverses, only I'd consider that cheating.
One would introduce more complex branches (looping backwards in CoffeeScript ain't easy) and the other would be using Underscore.js's range function to do the same thing - that solution would be basically identical to this, except without the reverses, only I'd consider that cheating.