text: # Definition for a binary tree node.
  class TreeNode:
      def __init__(self, x):
          self.val = x
          self.left = None
          self.right = None
  
  class Solution:
      def sumOfLeftLeaves(self, root):
          """
          :type root: TreeNode
          :rtype: int
          """
          if root is None:
              return 0
          sum = 0
          if root.left is not None and root.left.left is None and root.left.right is None:
              sum = root.left.val
          return sum + self.sumOfLeftLeaves(root.left) + self.sumOfLeftLeaves(root.right)
     
  if __name__ == '__main__':
      solution = Solution()
      node = TreeNode(3)
      node.left = TreeNode(9)
      node.right = TreeNode(20)
      node.right.left = TreeNode(15)
      node.right.right = TreeNode(7)
      print(solution.sumOfLeftLeaves(node))
  else:
      pass
  