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