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.
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..
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🥺🥺
❤❤❤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
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. 🙏
unordered_mapm;
int ans = 0;
m.insert({0,-1});
int sum = 0;
for(int i=0;i
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.
@@mathematics6199 can you please explain it?
@@joya9785 thats what I did na?
@@mathematics6199 I mean if u have the sample code
@@joya9785 haa okk
Literally I have seen many videos but have not got such clear explanation like you did here!!
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.
Nicely explained...You make these problems so easy...
Thank you so much!
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..
Can you solve competitive programing problems also i.e. codeforces? Your explanations are just phenomenal.
The best explanation in the entire youtube ....THANKS
di your explanation is very good. Thank u for delivering such quality content 😊😊😊😊
Thank you so much Nisha
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🥺🥺
❤❤❤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
It's wonderful and nice explanation ...I seen various platforms videos but u among 🔥
amazing ... easy to understand . thank you.
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 :(
You make the problem so easy. Thanks 👍
Do You Solve And Explain only LeetCode+GFG Or even CP Questions from CodeChef/Forces?
Awesome. Can be slow. And, also can conclude by going through the logic once again.
Great explanation !!!
literally the best explanation🔥
Good explanation
Keep it up, your channel has great future
Great Explanation! Thanks a Lot!
glad to see you back❤❤
Thank you so much ❤️❤️❤️
well explained
Thank you
well understood thanks
Thank you very much
🎉🎉 nic explain madam
Thank you di
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. 🙏
Thabn tou so much @Nightbird ..glad you found it helpful
🙇🙏
@@Shadow-lx9rh u need to count the no.of times where previously remainder has occured in the map.
👍🏻
💯💯
got the logic but not understanding the implementation, better to implement on its own @codewithalisa
well explained