input: Write a Python function to determine the minimum number of operations needed to make each element in a given list of integers divisible by 3. In each operation, you can either increase or decrease any element by 1. 
  
  For example:
  >>> nums = [1, 2, 3, 4]
  3
  >>> nums = [3, 6, 9]
  0
  
  Constraints:
  1 <= len(nums) <= 50
  1 <= nums[i] <= 50
output: def min_operations_to_make_divisible_by_3(nums):
      return sum(min(num % 3, 3 - num % 3) for num in nums)