input: Write a function to flatten a 2D matrix into a 1D list.
  assert flattenMatrix([[1,2,3], [4,5,6], [7,8,9]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]
  assert flattenMatrix([[1,2], [3,4], [5,6], [7,8]]) == [1, 2, 3, 4, 5, 6, 7, 8]
  assert flattenMatrix([[1], [2], [3]]) == [1, 2, 3]
output: def flattenMatrix(matrix):
      return [item for row in matrix for item in row]