input: 
  from typing import List
  
  def most_common(nums: List[int]) -> List[int]:
      """
      Find the most common elements in a given array of integers.
      If there are multiple elements with the same highest count, return all such elements.
      
      >>> most_common([3, 4, 1, 2, 5, 3, 3])
      [3]
      >>> most_common([2, 2, 3, 3, 3, 4, 4])
      [3]
      >>> most_common([1, 2, 3, 4, 5])
      [1, 2, 3, 4, 5]
      """
  
output:     count_dict = {}
      for num in nums:
          if num in count_dict:
              count_dict[num] += 1
          else:
              count_dict[num] = 1
      
      max_count = max(count_dict.values())
      most_common_elements = [num for num, count in count_dict.items() if count == max_count]
      
      return most_common_elements