Originally posted by Joseph Russell:
My problem is not how to solve 4b, I solved a while ago. Rather it is do I solve it recursively or not. This nitpick seems to indicate that a recursive method is the way to go while this thread says not too. I do not want to proceed coding this problem until I know for sure what is the most efficient or accepted way.
"Instead of a switch statement, you could have workIt return a number value to be used in the next call to workIt, and put the number %= ... equation in the method itself."
In this particular case an iterative approach works just as well as a recursive approach. A method does not need to be recursive to use a value that a previous call to the same method returns.