input: def optimize_sort(unsorted_list: List[int]) -> List[int]:
      """ Optimize the given list sorting function to have a time complexity of O(n) 
      by using an appropriate sort algorithm.
      >>> optimize_sort([2, 6, 3, 8, 4])
      [2, 3, 4, 6, 8]
      """
output:     count = [0] * (max(unsorted_list) + 1)
      for num in unsorted_list:
          count[num] += 1
      sorted_list = []
      for i in range(len(count)):
          sorted_list.extend([i] * count[i])
      return sorted_list