Skip to content

Commit 7877f45

Browse files
committed
Runtime: 182 ms (Top 71.60%) | Memory: 77.1 MB (Top 63.19%)
1 parent c2299ec commit 7877f45

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/algorithms/F/Find Two Non-overlapping Sub-arrays Each With Target Sum/Find Two Non-overlapping Sub-arrays Each With Target Sum.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 182 ms (Top 71.60%) | Memory: 77.1 MB (Top 63.19%)
12
class Solution {
23
public:
34
int minSumOfLengths(vector<int>& arr, int target) {
@@ -18,7 +19,7 @@ class Solution {
1819
prefix[end]=prefix[end-1>=0 ? end-1 : 0];
1920
}
2021
}
21-
22+
2223
sum=0;
2324
start=n-1;
2425
for(int end=n-1;end>=0;end--){
@@ -41,6 +42,6 @@ class Solution {
4142
res=min(res,prefix[i]+suffix[i+1]);
4243
}
4344
return res==INT_MAX ? -1 : res;
44-
45+
4546
}
46-
};
47+
};

0 commit comments

Comments
 (0)