input: Write a python function to sort arrays based on the second element of each sub-array.
  assert sort_array([[1, 6, 4], [4, 3, 2], [2, 3, 6]]) == [[4, 3, 2], [2, 3, 6], [1, 6, 4]]
  assert sort_array([[3, 3, 3], [2, 2, 2], [1, 1, 1]]) == [[1, 1, 1], [2, 2, 2], [3, 3, 3]]
  assert sort_array([[5, 7, 1], [4, 5, 9], [2, 3, 8]]) == [[2, 3, 8], [4, 5, 9], [5, 7, 1]]
output: def sort_array(arr):
      return sorted(arr, key=lambda x: x[1])