code: def majority_element_2(nums):
      counter = {}
  
      for num in nums:
          if num in counter:
              counter[num] += 1
          else:
              counter[num] = 1
  
      half = len(nums) // 2
      for num in counter:
          if counter[num] > half:
              return num
  
label_desc: Use image node_id 2 for calling a global function with example usage: majority_element_2(nums) and returns: num