Ad
  • Custom User Avatar

    O(n^2) because the for comprehension generates a cartesian product of the numbers vector with itself (or more specifically in this case, the indices of the numbers vector)

  • Custom User Avatar

    You can do a lot of programming without math, but some things can be done much better if you know math. The math in this problem is about finding the roots of a polynomial. Its Algebra.