input: Write a python function to traverse a 2D array and return all elements in a single list.
  assert traverse2DArray([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert traverse2DArray([[10, 20], [30, 40], [50, 60]]) == [10, 20, 30, 40, 50, 60]
  assert traverse2DArray([[1]]) == [1]
output: def traverse2DArray(array):
      result = []
      for row in array:
          for element in row:
              result.append(element)
      return result