input: Write a function to calculate the minimum and maximum values in an array. If the array is empty, return (None, None).
  assert min_max([1, 2, 3, 4, 5]) == (1, 5)
  assert min_max([5, 3, 8, 1, 9]) == (1, 9)
  assert min_max([10]) == (10, 10)
  assert min_max([]) == (None, None)
output: def min_max(arr):
      if not arr:
          return (None, None)
      return (min(arr), max(arr))