If the body of a simple for loop has time complexity $O(n)$ and it is executed $n-1$ times what is the time complexity of the complete loop?
I am trying to figure out the correct answer to this question for my upcoming exam. My reasoning is that if the body of the loop is executed $n-1$ times and its complexity is $n$ then the complete loop should have time complexity of $O(n \times (n-1)) = O(n^2 - 2) = O(n^2)$.
However, the correct answer given to us is $O(n^3)$. Am I missing something or is it just a mistake in the answers?
Edit: It turns out that the answer given to us was just wrong...