input: def dropLeafNodes(head): 
      """ Drop all leaf nodes from a given Huffman tree. A leaf node is a node that 
      doesn't have any children. The function should modify the tree in-place and 
      return the head of the modified tree.
      >>> class Node:
      ...     def __init__(self, val, left=None, right=None):
      ...         self.val = val
      ...         self.left = left
      ...         self.right = right
      >>> tree = Node(1, Node(2, Node(4), Node(5)), Node(3, Node(6), Node(7)))
      >>> result = dropLeafNodes(tree)
      >>> result.val
      1
      >>> not result.left.left
      True
      >>> not result.left.right
      True
      >>> not result.right.left
      True
      >>> not result.right.right
      True
      """
      # If node is not None and doesn't have any children 
      if head and not head.left and not head.right: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
    
      # Return head of the modified tree
      return head
output:     
      # If node is not None and doesn't have any children 
      if head and not head.left and not head.right: 
          return None
    
      # Don't change anything if head is None 
      if not head: 
          return None
    
      # Recursively call dropLeafNodes on left and right subtrees
      head.left = dropLeafNodes(head.left) 
      head.right = dropLeafNodes(head.right) 
    
      # Return head of the modified tree
      return head
  