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