Return the total sum of all leaf nodes in a n-ary tree in O(1) Space. You cannot use recursion as the call stack uses memory. You can construct the node class as you choose.
You cannot use any extra space, the solution has to be in O(1) space.