input: Write a python function to print elements of a two-dimensional array in a specific pattern.
  assert print_pattern([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == "1 2 3 \n4 5 6 \n4 5 6 7 8 9 \n"
  assert print_pattern([[10, 20], [30, 40], [50, 60]]) == "10 20 \n30 40 \n30 40 50 60 \n"
  assert print_pattern([[1]]) == "1 \n"
output: def print_pattern(arr):
      result = ""
      for i in range(len(arr)):
          if i == 0:
              result += " ".join(map(str, arr[i])) + " \n"
          else:
              for j in range(i, len(arr)):
                  result += " ".join(map(str, arr[j])) + " "
              result = result.strip() + " \n"
      return result