Recursion. It would make the code smaller, easier to understand, way easier to implement as well. What you are trying to do is one of the tasks recursion is very good at.
4 of 5
replaced http://stackoverflow.com/ with https://stackoverflow.com/
SanjiCode
- 121
- 2