Leetcode 5658. Maximum Absolute Sum of Any Subarray [Kadane's Algorithm detailed explanation]

preview_player
Показать описание
Maximum Absolute Sum of Any Subarray -- [Kadane's Algorithm]

My contact details

You can practice for coding interview from here

I am Mohammad Fraz , a final year Engineer at DTU and I create content for Coding and technical interviews for FAANG. I explain the intuition to solve Data Structure and Algorithm Questions from leetcode and other platforms. I also cover interview experiences for FAANG and other tech giants. You will also find lectures on the frequently asked interview quesrtions.
Рекомендации по теме
Комментарии
Автор

quite good expalantion, i didnt know this algorithm before, so ur explanation is actually too good

darshika
Автор

Nice explanation! 14:33 it should be -10 for the prefix sum of the negative value, not -12

OG_Scratch
Автор

why we take 2 diff boxes i donot understand because kadanes algo only take 1 box

jasmeenkaur
Автор

why u use ans = max({ans, box1, abs(box2)}); curly brackets here{} why does it means sir???

jasmeenkaur
Автор

How is mentioning "possibly empty subarray" in question affecting our solution ? How can it be empty?

muskansinghal
Автор

May I ask you what you use for drawing?

florianvogt
Автор

Bhaiya did u do 4th? Is 2D DP the best sol for that?

dheerjain