input: Write a function to calculate the mean and median of a given array. The function should return the mean and median as a tuple. If the array is empty, the function should return (0, 0).
  assert mean_median([10, 15, 20, 25, 30, 35]) == (22.5, 22.5)
  assert mean_median([1, 3, 4]) == (2.6666666666666665, 3)
  assert mean_median([1, 2, 3, 4, 5, 6]) == (3.5, 3.5)
  assert mean_median([]) == (0, 0)
output: def mean_median(arr):
      if not arr:
          return (0, 0)
      arr.sort()
      mean = sum(arr) / len(arr)
      n = len(arr)
      if n % 2 == 0:
          median = (arr[n//2 - 1] + arr[n//2]) / 2
      else:
          median = arr[n//2]
      return (mean, median)