filmov
tv
Maximum Absolute Sum of Any Subarray | Kadane's Algorithm | Leetcode 1749 | codestorywithMIK

Показать описание
Hi Everyone, this is the 144th video of our Playlist "Arrays 1D/2D : Popular Interview Problems".
Now we will be solving a good Array based 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
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
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
Комментарии