def reshape(array, step):
  """ Reshapes array of size n to matrix with dimensions n/step by step.

  Args:
    array: List to reshape.
    step: Number of elements in row after reshaping.
  """
  result = []
  for i in range(0, len(array), step):
    result.append(array[i:i+step])
  return result