input: 
  def third_largest(lst: List[int]) -> Optional[int]:
      """
      Returns the third largest element in a given list of integers, if it exists.
      If the list has fewer than 3 distinct elements, returns None.
  
      >>> third_largest([12, 13, 13, 45, 22, 99])
      22
      """
  
output:     if len(lst) < 3:
          return None
      
      unique_elements = list(set(lst))
      unique_elements.sort(reverse=True)
      
      if len(unique_elements) < 3:
          return None
      
      return unique_elements[2]