3013. Divide an Array Into Subarrays With Minimum Cost II | Sliding Window | Multisets

  Рет қаралды 2,207

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 3013. Divide an Array Into Subarrays With Minimum Cost II
Problem Link: leetcode.com/problems/divide-...
Checkout DSA-169 Series: • Aryan DSA-169 Series |...
100Days 100k Placements: • 100 Days 100K Placement
Sol1 - leetcode.com/problems/divide-...
Let's Connect:
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / ez.pz.dsa
📱Telegram : t.me/aryan_mittal_group
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
0:00 - Problem Explanation
3:12 - Brute Force / Basic Approach
6:53 - Intuition
12:46 - Explanation
21:22 - Dry Run
26:00 - Code Explanation
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 8
@abdulsakibshekhayyub3498
@abdulsakibshekhayyub3498 6 ай бұрын
Best channel for leetcoders
@ShivamKumar-zn4uc
@ShivamKumar-zn4uc 6 ай бұрын
Fantastic approach and intuition brother, thanks for this video
@shivamgarg269
@shivamgarg269 6 ай бұрын
Good explanation brother..😊😊✌✌
@sahilanand30
@sahilanand30 6 ай бұрын
Awesome explanation
@sunny_23561
@sunny_23561 6 ай бұрын
great explanation.. Thanks Alot
@nikhilahuja6301
@nikhilahuja6301 6 ай бұрын
great explanation🔥🔥
@divyanshojha9888
@divyanshojha9888 6 ай бұрын
By using only one multiset does we have difficulty while removing elements?
@divyanshojha9888
@divyanshojha9888 6 ай бұрын
why I'm getting WA for tc 673 class Solution { public: long long minimumCost(vector& nums, int k, int dist) { long long ans=INT_MAX,cur=nums[0],n=nums.size(); multisetl,r; k--; int j=1; for(int i=1;idist){ if(l.find(nums[j])!=l.end()){ cur-=nums[j]; auto it = l.find(nums[j]); l.erase(it); } else{ auto it = r.find(nums[j]); r.erase(it); } j++; } if(i-j==dist){ if(l.size()==k) ans=min(ans,cur); } } return ans; } };
Generative AI in a Nutshell - how to survive and thrive in the age of AI
17:57
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 22 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 58 МЛН
30 Days Javascript LeetCode Challenge | Day-1 | Vishwa Mohan
21:55
Vishwa Mohan
Рет қаралды 3,4 М.
CrunchLabs Masters 2024 | Winners SemiFinals | Magnus, MVL, Alireza & Duda
23:53
Chess Puzzles and Tactics
Рет қаралды 13 М.
Quick Sort Using Recursion (Theory + Complexity + Code)
42:14
Kunal Kushwaha
Рет қаралды 163 М.
Genetic Algorithms Explained By Example
11:52
Kie Codes
Рет қаралды 317 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1 МЛН