




from graphs.minimum_spanning_tree_kruskal import kruskal



def      __lowerCAmelCase			(					)     ->	str:
  lowerCAmelCase__				:  str		       =     9
  lowerCAmelCase__				:  int		       =     [
      [0, 1, 4],
      [0, 7, 8],
      [1, 2, 8],
      [7, 8, 7],
      [7, 6, 1],
      [2, 8, 2],
      [8, 6, 6],
      [2, 3, 7],
      [2, 5, 4],
      [6, 5, 2],
      [3, 5, 14],
      [3, 4, 9],
      [5, 4, 10],
      [1, 7, 11],
  ]

  lowerCAmelCase__				:  str		       =     kruskal(UpperCamelCase	,      UpperCamelCase      )

  lowerCAmelCase__				:  Union[str, Any]		       =     [
      [7, 6, 1],
      [2, 8, 2],
      [6, 5, 2],
      [0, 1, 4],
      [2, 5, 4],
      [2, 3, 7],
      [0, 7, 8],
      [3, 4, 9],
  ]

  assert sorted(UpperCamelCase      ) == sorted(UpperCamelCase      )







from __future__ import annotations



def      __lowerCAmelCase			(					UpperCamelCase      )     ->	list[int]:  # This function is recursive
  lowerCAmelCase__				:  Tuple		       =     len(UpperCamelCase      )
  # If the array contains only one element, we return it (it's the stop condition of
  # recursion)
  if array_length <= 1:
    return array
    # Else
  lowerCAmelCase__				:  Optional[int]		       =     array[0]
  lowerCAmelCase__				:  Union[str, Any]		       =     False
  lowerCAmelCase__				:  List[str]		       =     1
  lowerCAmelCase__				:  list[int]		       =     []
  while not is_found and i < array_length:
    if array[i] < pivot:
      lowerCAmelCase__				:  List[Any]		       =     True
      lowerCAmelCase__				:  Optional[int]		       =     [element for element in array[i:] if element >= array[i]]
      lowerCAmelCase__				:  Any		       =     longest_subsequence(UpperCamelCase      )
      if len(UpperCamelCase      ) > len(UpperCamelCase      ):
        lowerCAmelCase__				:  Optional[int]		       =     temp_array
    else:
      i += 1

  lowerCAmelCase__				:  Optional[Any]		       =     [element for element in array[1:] if element >= pivot]
  lowerCAmelCase__				:  List[Any]		       =     [pivot, *longest_subsequence(UpperCamelCase      )]
  if len(UpperCamelCase      ) > len(UpperCamelCase      ):
    return temp_array
  else:
    return longest_subseq


if __name__ == "__main__":
     import doctest

     doctest.testmod()

