sum holds the sum of all the left leaves
sum = 0 NEW_LINE while len ( stack ) > 0 : NEW_LINE INDENT currentNode = stack . pop ( ) NEW_LINE if currentNode . left is not None : NEW_LINE INDENT stack . append ( currentNode . left ) NEW_LINE DEDENT DEDENT