Max elemennt doubt

in the video sir said that the bruteforce approach will be of O(N^2) but in brutr force approach there will be 2 loops one 0 to n-1 and another i to i+3 so first loop wiil run for n times and for every time the inner loop will run for 3 times so it will be of O(N)

@deepakjumani09 Why would it be 3 always ? It will be k times and k can vary from 1 to n.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.