Doubt in brute force algorithm of sum of subarray


loop is not incrementing

@chiraggaur45 hey chirag your code is not right if you’re implementing a brute force then your code complexity must be n^3 go and watch the course video on this implementation.


sir but in the course same algorithm was taught…

@chiraggaur45
This was O(n^6) video tutorial. In its subsequent video , a O(n^4) solution was discussed and in the next , a O(n^2) solution was discussed as well. Use the optimised solution.

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.