Lets say I have a single input of the value 5432. I want these values to be added together like this:
5 + 4 + 3 + 2 = 14
What are the different ways you can code this in a recursion function? So far I've thought about populating an array, but I believe it has to be a single input. What I had in mind would require 4 inputs to populate the array.
Another way was to convert string to int but I'm not sure if I could do it due the single input problem.