Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Kadane(std::vector<int>& T)
- {
- for (int i = 0, mx = 0, sum = 0; i < T.size(); i++)
- {
- sum += T[i];
- mx = max(mx, sum = max(sum, 0));
- }
- return mx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement