input: Write a function to get the third largest element in a given list. If the list contains less than three distinct elements, the function should return None.
  
  def third_largest(lst):
      if len(lst) < 3:
          return None
      distinct = []
      for i in lst:
          if i not in distinct:
              distinct.append(i)
      distinct.sort(reverse=True)
      if len(distinct) < 3:
          return None
      return distinct[2]
  
  assert third_largest([12, 13, 13, 45, 22, 99]) == 22
  assert third_largest([1, 2, 3, 4, 5]) == 3
  assert third_largest([1, 1, 2, 2, 3]) == 1
  assert third_largest([1, 1, 1, 2, 2]) == 1
  assert third_largest([1, 2]) == None
output: def third_largest(lst):
      if len(lst) < 3:
          return None
      distinct = []
      for i in lst:
          if i not in distinct:
              distinct.append(i)
      distinct.sort(reverse=True)
      if len(distinct) < 3:
          return None
      return distinct[2]