You are viewing a single comment's thread. Return to all comments →
What is the need of reverse sequence? Please explain.
To handle cases like the following:
5 4 3 2 1
Somehow, the algorithm must be 'smart' enough to know that the leftmost child will have five pieces of candy.