What should be the time complexity for the brute force solution described. Shouldn’t it be O(n^3) , as for each index of the array we add from 1 to n-1 , so O(n^2) for each element and then O(n^3) for the entire array.
The video mentions brute force as O(n^2).