input: Write a python function to find the largest and smallest numbers in an array.
  assert largest_smallest([7, 9, 5, 4, 8, 1]) == (1, 9)
  assert largest_smallest([12, 15, 7, 19, 3, 10]) == (3, 19)
  assert largest_smallest([-2, -6, -3, -8, -1]) == (-8, -1)
output: def largest_smallest(arr):
      if not arr:
          return (None, None)
      smallest = min(arr)
      largest = max(arr)
      return (smallest, largest)