Hi, I need some help on this. I need to convert the recursive version to iteration version using while loop but I just cant get it right. There is something wrong with my iteration version..Thanks you alot!
[code]Your code goes here.[/code]
In the iterative version you are calculating one number ahead, so the loop should end early. You may want to change the handling of the special cases.