educative.io

Possible mistake on quiz

Hi, should’t the answer of the quiz be 5n^2 + 3n + 3 instead of +4 ?

I can’t see from where an extra execution is coming from since sum=0 is being executed n times being inside the first loop, as the answer of the problem also states.

Many thanks

Hi Krish,
The right answer in the quiz is already 5n^2 + 3n + 3 . If it was +4 before than it has been rectified.