Maximum Subarray[dp]

why the broute force approach takes O(n^3) time , i can’t get it please provide snippet

hey @dhruv.160410116084 in the brute force we will generate every possible subarray which takes O(n^2) and then we will iterate each generated subarray which will take O(n) so the total time would become O(n^3).
Here is the code with the same implemented: