filmov
tv
Maximum absolute sum of any subarray | dynamic programming | Leetcode#1749
Показать описание
Hey my friend, welcome to joey’s dynamic tutorial and gear up to watch an amazing problem from the world of dynamic programming.
'Maximum absolute sum of any subarray'
I have made videos on maximum subarray, and maximum product subarray already.
It would be better if you first watched these videos and then resume from here.
Maximum sum subarray using DP
Maximum product subarray
If you have already watched those videos then understanding this problem from Leetcode won’t be difficult for you.
Let’s check out its problem statement now but before that I humbly request you to subscribe to my channel and hit the bell icon next to it because that way you are not going to miss out on any videos I release in the future.
An integer array is given to you.
You need to find out the maximum absolute sum of any subarray from the given array.
So absolute sum means when the sum is negative then abs(sum) will be -sum.
When the sum is positive then the abs(sum) will be simply +sum.
Suppose if i, j, and k are the three elements of a subarray then note that the absolute sum will be the absolute function of the addition of i + j + k
And not the sum of the absolute functions applied on i , j, and k.
Github link Java solution
'Maximum absolute sum of any subarray'
I have made videos on maximum subarray, and maximum product subarray already.
It would be better if you first watched these videos and then resume from here.
Maximum sum subarray using DP
Maximum product subarray
If you have already watched those videos then understanding this problem from Leetcode won’t be difficult for you.
Let’s check out its problem statement now but before that I humbly request you to subscribe to my channel and hit the bell icon next to it because that way you are not going to miss out on any videos I release in the future.
An integer array is given to you.
You need to find out the maximum absolute sum of any subarray from the given array.
So absolute sum means when the sum is negative then abs(sum) will be -sum.
When the sum is positive then the abs(sum) will be simply +sum.
Suppose if i, j, and k are the three elements of a subarray then note that the absolute sum will be the absolute function of the addition of i + j + k
And not the sum of the absolute functions applied on i , j, and k.
Github link Java solution
Комментарии