File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
dsa-solutions/lc-solutions/1500-1599 Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -66,20 +66,20 @@ Output:
66
66
### Time Complexity and Space Complexity Analysis
67
67
68
68
- ** Initialization** :
69
- - Sorting the cuts array takes O(m log m) time, where m is the number of cuts.
70
- - Initializing the ` dp ` array takes O(m^2) time.
71
- - Overall initialization time complexity is O(m log m + m^2).
69
+ - Sorting the cuts array takes $ O(m log m)$ time, where m is the number of cuts.
70
+ - Initializing the ` dp ` array takes $ O(m^3)$ time.
71
+ - Overall initialization time complexity is $ O(m log m + m^2)$ .
72
72
73
73
- ** DP Table Calculation** :
74
74
- Filling the ` dp ` table involves iterating over all possible subintervals and calculating the minimum cost for each subinterval using nested loops.
75
- - This takes O(m^3) time in the worst case.
75
+ - This takes $ O(m^3)$ time in the worst case.
76
76
77
77
- ** Overall Time Complexity** :
78
- - The overall time complexity is O(m^3).
78
+ - The overall time complexity is $ O(m^3)$ .
79
79
80
80
- ** Space Complexity** :
81
- - The ` dp ` table requires O(m^2) space.
82
- - The space complexity is O(m^2).
81
+ - The ` dp ` table requires $ O(m^2)$ space.
82
+ - The space complexity is $ O(m^2)$ .
83
83
84
84
### Code
85
85
You can’t perform that action at this time.
0 commit comments