Maximum Absolute Sum of Any Subarray | Kadane's Algorithm | Leetcode 1749 | codestorywithMIK
iPAD PDF Notes : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad PDF Notes/Leetcode - 1749.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Hi Everyone, this is the 144th video of our Playlist "Arrays 1D/2D : Popular Interview Problems".
Now we will be solving a good Graph problem - Maximum Absolute Sum of Any Subarray | Kadane's Algorithm | Leetcode 1749 | codestorywithMIK
We will also study what Kadane's Algorithm is and how this problem is related to it.
Kadane's Algorithm is a very famous technique used to find the maximum sum subarray in a given array of numbers. It works by iterating through the array while maintaining a running sum (current_sum) and updating the maximum sum (max_sum) found so far. You can tweak it to find minimum sum subarray as well.
Problem Name : Maximum Absolute Sum of Any Subarray | Kadane's Algorithm | Leetcode 1749 | codestorywithMIK
Company Tags : will update later
My solutions on Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Arrays/Cumulative_Sum(Prefix Array)/Maximum Absolute Sum of Any Subarray.cpp
Leetcode Link : https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray
My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | ...
My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will...
My Segment Tree Concepts Playlist : • Segment Tree | Introduction | Basics ...
My Recursion Concepts Playlist : • Introduction | Recursion Concepts And...
Trie Playlist - • Word Search II (Google, Amazon, Meta,...
Difference Array Technique: Concepts & Qns : • Introduction | What | How | Differenc...
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel : / @codestorywithmik
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
Video Summary :
Approach 1 (Two-Pass Kadane’s Algorithm):
This approach runs Kadane’s Algorithm twice—first to find the maximum subarray sum and then to find the minimum subarray sum. The intuition is that the absolute value of the minimum subarray sum could be larger than the maximum subarray sum, so both need to be considered. Finally, the result is the maximum of these two values.
Approach 2 (One-Pass Kadane’s Algorithm):
This approach optimizes the process by combining both calculations into a single pass through the array. It simultaneously tracks the maximum and minimum subarray sums, updating them as it iterates. By doing this in one loop, we achieve the same result with improved efficiency while maintaining clarity in logic.
✨ Timelines✨
00:00 - Introduction
0:25 - Motivation
1:07 - Problem Explanation
3:09 - Thought Process
4:23 - Why maxSubarraySum and minSubarraySum only ?
8:09 - One more example
13:25 - Why Kadane's Algorithm
14:56 - What is Kadane's Algorithm + Dry Run
24:48 - coding : 2 Pass Solution
28:01 - Coding : 1 Pass Solution
#MIK #mik #Mik
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik