code: def matrix_chain_mult(M):
      
      opt, arg = matrix_mult_opt_order(M)
      return _apply_order(M, arg, 0, len(M)-1)
docs: Matrix chain multiplication
  
      :param M: list of matrices
      :returns: M[0] * ... * M[-1], computed in time optimal order
      :complexity: whatever is needed by the multiplications