input: Write a python function to replace duplicates in a list with their counts.
  assert check_duplicates_replace([1, 2, 3, 2, 1, 3]) == [1, 1, 1, 2, 2, 3]
  assert check_duplicates_replace([4, 5, 4, 5, 4, 5]) == [1, 1, 2, 2, 3, 3]
  assert check_duplicates_replace([7, 8, 9]) == [1, 1, 1]
output: def check_duplicates_replace(lst):
      count_dict = {}
      result = []
      
      for num in lst:
          if num not in count_dict:
              count_dict[num] = 1
          else:
              count_dict[num] += 1
          result.append(count_dict[num])
      
      return result