input: Write a function to return the third largest element in a given list of integers. If the list has fewer than three distinct elements, return None. The function should handle duplicates by considering only distinct values.
  assert third_largest([12, 13, 13, 45, 22, 99])==22
  assert third_largest([1, 2, 3, 4, 4])==2
  assert third_largest([9, 8, 7, 6, 5, 4, 3, 2, 1])==7
  assert third_largest([1, 2])==None
  assert third_largest([1, 1, 1, 1])==None
output: def third_largest(lst):
      distinct_values = list(set(lst))
      if len(distinct_values) < 3:
          return None
      distinct_values.sort(reverse=True)
      return distinct_values[2]