Longest subarray with sum divisible by K | GfG problem of the day

  Рет қаралды 11,528

Code with Alisha

Code with Alisha

Күн бұрын

Use coupon ALISHA on any GeeksforGeeks course to get 10% discount:
practice.geeks...
Join this channel to get access to perks:
/ @probabilitycodingisfu...
Connect with me on LinkedIn : / alisha-parveen-80579850
Check out our other playlists:
Dynamic Programming:
• Dynamic Programming
Trees:
• Trees
Heaps and Maps:
• Heaps and Maps
Arrays and Maths:
• Arrays and Maths
Bit Manipulation:
• Bit Manipulation
Greedy Algorithms:
• Greedy Algorithms
Sorting and Searching:
• Sorting and Searching
Strings:
• Strings
Linked Lists:
• Linked Lists
Stack and Queues:
• Stacks and Queues
Two Pointers:
• Two pointers
Graphs, BFS, DFS:
• Graphs, DFS, BFS
Backtracking:
• Backtracking
Non- DSA playlists:
Probability:
• Probability
SQL-Basic Join functions:
• SQL - Basic JOIN Funct...
SQL-Basic Aggregate functions:
• SQL-Basic Aggregate Fu...

Пікірлер: 47
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
unordered_mapm; int ans = 0; m.insert({0,-1}); int sum = 0; for(int i=0;i
@mathematics6199
@mathematics6199 2 жыл бұрын
Didi, one best optmization that we can use is, maintain a vector of pairs of the prefix sum remainders and sort them. This is much useful because worst case complexity of unordered map is worser than the cost of sorting. And also hash map is much wastage of memory.
@joya9785
@joya9785 2 жыл бұрын
@@mathematics6199 can you please explain it?
@mathematics6199
@mathematics6199 2 жыл бұрын
@@joya9785 thats what I did na?
@joya9785
@joya9785 2 жыл бұрын
@@mathematics6199 I mean if u have the sample code
@mathematics6199
@mathematics6199 2 жыл бұрын
@@joya9785 haa okk
@krishnaradhey2814
@krishnaradhey2814 2 жыл бұрын
Literally I have seen many videos but have not got such clear explanation like you did here!!
@dheerajkumar824
@dheerajkumar824 2 жыл бұрын
it doesn't need extra 'n' complexity for sum (in brute force approach), it can be done within 'n^2' itself. Though it was further optimized.
@themarketverse
@themarketverse 2 жыл бұрын
Nicely explained...You make these problems so easy...
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much!
@haha44261
@haha44261 15 сағат бұрын
i have seen its solution for first time, the technique is OP🙌🏻
@gautamjangir8927
@gautamjangir8927 2 жыл бұрын
The best explanation in the entire youtube ....THANKS
@Madhu__06
@Madhu__06 2 ай бұрын
amazing ... easy to understand . thank you.
@karma_kar9623
@karma_kar9623 2 жыл бұрын
Can you solve competitive programing problems also i.e. codeforces? Your explanations are just phenomenal.
@inthearts4525
@inthearts4525 10 ай бұрын
what an explanation... just awesome.. saw a lot of videos but such a great explanation was missing... subscribing you and looking forward for many more amazing and crystal clear explanations..
@notskinner2304
@notskinner2304 2 жыл бұрын
Hard to come up with this in an interview ; I would be stuck after calculating prefix sum and would be confused how to do it using two pointers :(
@shanayagupta4002
@shanayagupta4002 2 жыл бұрын
di your explanation is very good. Thank u for delivering such quality content 😊😊😊😊
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much Nisha
@rrrhitk
@rrrhitk Жыл бұрын
literally the best explanation🔥
@joe0212
@joe0212 2 жыл бұрын
Awesome. Can be slow. And, also can conclude by going through the logic once again.
@gizmogaurav
@gizmogaurav 2 жыл бұрын
You make the problem so easy. Thanks 👍
@zishan53
@zishan53 2 жыл бұрын
It's wonderful and nice explanation ...I seen various platforms videos but u among 🔥
@AnuragYadav-nj2zc
@AnuragYadav-nj2zc 2 жыл бұрын
Great explanation !!!
@lilyren7256
@lilyren7256 2 жыл бұрын
awwww you are back! plz make more videos!!! And can you make a video to share how you start solving programming problems and what courses you have taken🥺🥺
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
❤❤❤Thank you Lily... Will try to make more videos, i just started Leetcode easy problems and moved to medium, I had taken GeeksforGeeks live DSA course
@chakravarty-with-a-v
@chakravarty-with-a-v 2 жыл бұрын
Great Explanation! Thanks a Lot!
@Rajat_maurya
@Rajat_maurya 2 жыл бұрын
Thank you
@gigachad2419
@gigachad2419 2 жыл бұрын
Do You Solve And Explain only LeetCode+GFG Or even CP Questions from CodeChef/Forces?
@mayankshekhar4754
@mayankshekhar4754 2 жыл бұрын
well explained
@vivekpaliwal1876
@vivekpaliwal1876 Жыл бұрын
Good explanation Keep it up, your channel has great future
@sristysingh2175
@sristysingh2175 2 жыл бұрын
glad to see you back❤❤
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much ❤️❤️❤️
@TheElevatedGuy
@TheElevatedGuy 2 жыл бұрын
Thank you di
@samajayadeepu3476
@samajayadeepu3476 2 жыл бұрын
well understood thanks
@abhisheknair5630
@abhisheknair5630 2 жыл бұрын
Thank you very much
@reshmaparveen6679
@reshmaparveen6679 Жыл бұрын
🎉🎉 nic explain madam
@meandpenguinvlogs8221
@meandpenguinvlogs8221 2 жыл бұрын
💯💯
@alishabeautyparlour6283
@alishabeautyparlour6283 2 жыл бұрын
👍🏻
@Shadow-lx9rh
@Shadow-lx9rh 2 жыл бұрын
Thank you again I'm able to solve this question and another question in leetcode which askd to count the number of subarray sum divisible by k (974) I just had to count the number of places where previously the remainder had occurred Thank yooooo soo much the way you explained -ve remainder concept and the whole problem was just marvelous. Thank you from the core of my heart. 🙏
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thabn tou so much @Nightbird ..glad you found it helpful
@Shadow-lx9rh
@Shadow-lx9rh 2 жыл бұрын
🙇🙏
@KrishnaKumar-b4m9p
@KrishnaKumar-b4m9p Ай бұрын
@@Shadow-lx9rh u need to count the no.of times where previously remainder has occured in the map.
@vikasviplav8678
@vikasviplav8678 8 ай бұрын
got the logic but not understanding the implementation, better to implement on its own @codewithalisa
@chestupheadup7410
@chestupheadup7410 9 ай бұрын
well explained
Help a Thief!!! GeeksforGeeks Problem of The Day | 10/6/22
13:14
Code with Alisha
Рет қаралды 1,6 М.
974. Subarray Sums Divisible by K | PrefSum | Not an Easy Problem
17:19
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 30 МЛН
Subarray Sum Equals K - Prefix Sums - Leetcode 560 - Python
15:19
Leetcode 2401. Longest Nice Subarray | Weekly Contest 2401.
19:54
Code with Alisha
Рет қаралды 6 М.
Count Subarray sum Equals K | Brute - Better -Optimal
24:09
take U forward
Рет қаралды 337 М.
Subarray Sums Divisible by K - Leetcode 974 - Python
16:41
NeetCodeIO
Рет қаралды 18 М.
Count pairs in array divisible by K | GeeksforGeeks Problem of The Day
11:08
Subarray Sums Divisible by K | LeetCode 974 | C++, Java, Python
16:48
Knowledge Center
Рет қаралды 34 М.
Count Subarrays with Xor as K | This problem clears a lot of concepts
16:50
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН