input: Write a python function to sort the elements in the list by their occurrence.
  assert sort_by_occurrence([1, 2, 2, 3, 3, 3, 4])==[3, 3, 3, 2, 2, 1, 4]
  assert sort_by_occurrence([4, 4, 4, 4, 3, 3, 2, 2, 1])==[4, 4, 4, 4, 3, 3, 2, 2, 1]
  assert sort_by_occurrence([7, 7, 7, 1, 1, 1, 1, 3, 3, 5, 5, 5, 5, 5])==[5, 5, 5, 5, 5, 1, 1, 1, 1, 7, 7, 7, 3, 3]
output: def sort_by_occurrence(lst):
      from collections import Counter
      counts = Counter(lst)
      return sorted(lst, key=lambda x: (-counts[x], lst.index(x)))