LeetCode 689.Maximum Sum of 3 Non-Overlapping Subarrays | JSer - JavaScript & Algorithm

preview_player
Показать описание
Subarray problem, following clues might be helpful
1. cacheing the sum from left and from right, sum(i, j) could be derived by sum(j) - sum(i)
2. use sliding window to calculate the sum array
3. for 3 sum problem, fix the middle index, and the rest is symetric
4.

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.
Рекомендации по теме
Комментарии
Автор

I've been watching several videos for this question but didn't quite understand how they came up with this idea.
What they just mentioned is that it's sliding window and wrote code.
Now I understand the idea for this solution.
Thanks

satang
visit shbcf.ru