
'''simple docstring'''

def 		_UpperCAmelCase			(					_lowerCamelCase  :    int					, _lowerCamelCase  :    list						)      ->  list:
  _lowerCAmelCase    :					int							=   sorted(_lowerCamelCase					, key=lambda _lowerCamelCase						: value[2]					, reverse=_lowerCamelCase						)

  # Create a list of size equal to the maximum deadline
  # and initialize it with -1
  _lowerCAmelCase    :					List[Any]							=   max(_lowerCamelCase					, key=lambda _lowerCamelCase						: value[1]						)[1]
  _lowerCAmelCase    :					Any							=   [-1] * max_deadline

  # Finding the maximum profit and the count of jobs
  _lowerCAmelCase    :					Dict							=   0
  _lowerCAmelCase    :					str							=   0
  for job in jobs:
    # Find a free time slot for this job
    # (Note that we start from the last possible slot)
    for i in range(job[1] - 1					, -1					, -1						):
      if time_slots[i] == -1:
        _lowerCAmelCase    :					Union[str, Any]							=   job[0]
        count += 1
        max_profit += job[2]
        break
  return [count, max_profit]


if __name__ == "__main__":
     import doctest

     doctest.testmod()




'''simple docstring'''

from __future__ import annotations


class 					a_					:




       def __init__(       self				,				snake_case_ = 0					):
         _lowerCAmelCase    :					Optional[Any]							=   value
         _lowerCAmelCase    :					Node | None							=   None
         _lowerCAmelCase    :					Node | None							=   None



def 		_UpperCAmelCase			(					_lowerCamelCase  :    Node | None					, _lowerCamelCase  :    Node | None						)      ->  Node | None:
  if treea is None:
    return treea
  if treea is None:
    return treea

  _lowerCAmelCase    :					Any							=   treea.value + treea.value
  _lowerCAmelCase    :					Tuple							=   merge_two_binary_trees(treea.left					, treea.left						)
  _lowerCAmelCase    :					List[str]							=   merge_two_binary_trees(treea.right					, treea.right						)
  return treea


def 		_UpperCAmelCase			(					_lowerCamelCase  :    Node | None						)      ->  None:
  if root:
    print(root.value						)
    print_preorder(root.left						)
    print_preorder(root.right						)


if __name__ == "__main__":
     UpperCamelCase_            =    Node(1)
     UpperCamelCase_            =    Node(2)
     UpperCamelCase_            =    Node(3)
     UpperCamelCase_            =    Node(4)

     UpperCamelCase_            =    Node(2)
     UpperCamelCase_            =    Node(4)
     UpperCamelCase_            =    Node(6)
     UpperCamelCase_            =    Node(9)
     UpperCamelCase_            =    Node(5)

     print("""Tree1 is: """)
     print_preorder(treea)
     print("""Tree2 is: """)
     print_preorder(treea)
     UpperCamelCase_            =    merge_two_binary_trees(treea, treea)
     print("""Merged Tree is: """)
     print_preorder(merged_tree)


