input: from typing import List
  
  def third_largest(lst: List[int]) -> int:
      """
      Get the third largest element in a given list.
  
      >>> third_largest([12, 13, 13, 45, 22, 99])
      22
      """
output:     if len(lst) < 3:
          raise ValueError("List must contain at least three elements")
      
      first = second = third = float('-inf')
      
      for num in lst:
          if num > first:
              third = second
              second = first
              first = num
          elif num > second and num != first:
              third = second
              second = num
          elif num > third and num != second and num != first:
              third = num
      
      return third