Subarray Sums Divisible by K | Brute Force | Optimal | Easy Explanation | codestorywithMIK

  Рет қаралды 16,869

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 202
@varunyadav6560
@varunyadav6560 Жыл бұрын
Best video on youtube to understand the concept of this question..Thank you so much brother 💖
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much Varun ❤️❤️❤️
@thexzavier8283
@thexzavier8283 Жыл бұрын
Bruv don't stop uploading you are gonna get that 1M in no time, the way you explained all the mathematical stuff was too good👍
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot 😇❤️
@rguktiiit371
@rguktiiit371 Жыл бұрын
++
@ramandeepsingh8464
@ramandeepsingh8464 8 ай бұрын
kya video hai bhiya OP 🙂lot a way better than all bhiya's & didi's here we are using the modulo property which is (a-b)%m = (a%m - b%m + m)%m
@robot3.077
@robot3.077 3 сағат бұрын
Thanks
@VivekPathak-ds2do
@VivekPathak-ds2do 3 ай бұрын
You are the only one jo ye pahle batate ho ki socha kaise jata h. Fir prove krte ho. Yhi reason hai ki apki videos baki youtube videos se better hoti h. Or aapke concept dekhne k baad mere ko code dekhne ki need aaj tk nhi hui.
@parth5183
@parth5183 3 ай бұрын
True, I rarely felt the need to see the code, once I saw his explanation
@Momentsofmagic28
@Momentsofmagic28 3 ай бұрын
True
@pratik.784
@pratik.784 Жыл бұрын
Aapke 1 million jald hoga 🤩
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Tysm ❤️❤️❤️
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
Sach me yaar. This guy is on fire
@tusharrajput983
@tusharrajput983 3 ай бұрын
I don't care how many subscribers or views you have. But you always have the best way of explaining questions. this is absolute luxury to have all this for free.
@sourav-bisht
@sourav-bisht 2 ай бұрын
No one explains like you bro You are the best
@adhikari669
@adhikari669 Жыл бұрын
Bhaya aisa content pure KZbin m khi ni h, na hi aisi awaj ❤️
@LifeYetLive
@LifeYetLive 2 ай бұрын
Bhai maja aa gya ❤ itna acche sai toh kisi ne nai samjya abhi tak
@CodingGuru92
@CodingGuru92 4 күн бұрын
I am a huge fan of your teaching style. I have leaned DP also from your videos. You are doing a great job. Keep it up 👍.
@rahulpandey5094
@rahulpandey5094 Жыл бұрын
best way of explaining I have ever seen . Thank you so much sir .🙏
@codestorywithMIK
@codestorywithMIK Жыл бұрын
So nice of you. Thank you so much for watching 😇🙏
@venkatarohitpotnuru38
@venkatarohitpotnuru38 3 ай бұрын
corner case is just lit🔥
@himanshusharma9132
@himanshusharma9132 3 ай бұрын
Bruteforce approach - O(n3) passed 70/73 testcases Bruteforce approach with O(1) sum testcase passed 69/73 testcases Thanks Bhaiya , your approach always improves my logic building skills
@drbullah1388
@drbullah1388 Жыл бұрын
Probably the best channel for learning the concept rather than the code Bhaiya confidence hai ki agar aapke saath daily LeetCode problems karte raha to kuch hi dino me pura pura khud se solve kar paunga Thanks for being there on youtube sharing all your knowledge
@codestorywithMIK
@codestorywithMIK Жыл бұрын
I am so glad to hear that. And indeed we all will grow together 💪
@shobhitsharma2137
@shobhitsharma2137 8 ай бұрын
Bro your explanation is so good that I can’t even imagine how you could have been able do this
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
🙏🙏❤️❤️
@akmarkan2490
@akmarkan2490 3 ай бұрын
Insane my brother⚔️⚔️🥵
@ece39pranshupatel71
@ece39pranshupatel71 3 ай бұрын
Thank you so much bhaiya..best explanation for modulo concept 💥❤️
@nagmakhan3165
@nagmakhan3165 Жыл бұрын
The best explanation on KZbin for this video
@yashika6248
@yashika6248 Жыл бұрын
After trying so hard to grasp the concept, I finally came across this video and now I am thankful
@nileshdeshmukh7841
@nileshdeshmukh7841 Жыл бұрын
Make daily videos bhaiya , it will help me to crack companies , my interview is scheduled and if I watch your video daily , i will definetly crack good companies , bcoz same I will going to explain in Interview starts from brute force to optimised. please keep uploading video daily !
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Sure All the very best
@atifhu
@atifhu Жыл бұрын
every time I am stuck in the ques, I know MIK is there for me❤🙌
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Tysm Atifhu 💓
@AbhayGupta-oz1ix
@AbhayGupta-oz1ix 2 ай бұрын
Two amazing concepts : 1,2,3.....n.......m 1) Sumtill(n) % k == Sumtill(m) % k means Sum(n...m) is divisible by k. Got it Thanks to sir. 2) mod = num % k ; if (mod < 0) mod = k - mod // the edge case
@gui-codes
@gui-codes 3 ай бұрын
Kya mast samjhate ho bhai. love you bhai Better than any video present on this problem on youtube
@souravjoshi2293
@souravjoshi2293 Жыл бұрын
And the PERFECTION is here
@rockykumarverma980
@rockykumarverma980 9 сағат бұрын
Thank you so much Bhaiya ji 🙏🙏🙏
@pradyumnmulegaon385
@pradyumnmulegaon385 3 ай бұрын
i appreciate the depth of explanation that you have given in this video🔥🔥
@kalp2586
@kalp2586 2 ай бұрын
Amazing explanation.
@kumarimegha9187
@kumarimegha9187 Жыл бұрын
Literally i have no words for this video....your explanation is awesome.... thankyou so much 💖
@_jaydip74
@_jaydip74 Жыл бұрын
Hey Brother , I watch your videos daily and I just want to tell you that You are doing great work . Keep it up 🤗 . Love From Gujarat ❣. Thank you for the daily videos. 🙌
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Jaydip ❤️❤️❤️
@jaygala6699
@jaygala6699 Жыл бұрын
great explanation!!! keep making these videos 👍👍
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Tysm Jay ❤️❤️❤️
@Sachin_Alam
@Sachin_Alam Жыл бұрын
Thanks a ton for the Cumulative sum approach.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Happy to help ❤️
@OtakRajCodes
@OtakRajCodes Жыл бұрын
wonderful explanation as always . Your method of first proving why the concept/technique works and then implementing it is awesome!! keep up the good work :)
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Tysm ❤️❤️❤️
@thecricketerraja
@thecricketerraja Жыл бұрын
ur level of explanation 💥, tnku soo much bhai ❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much ❤️😇🙏
@tusharrajput983
@tusharrajput983 3 ай бұрын
for anyone wondering about the school division concept : In modular arithmetic, the remainder is always a non-negative number less than the divisor. So (-4 % 7 would be = 3). you are thinking right. but In C++ (idk about other languages), the modulus operation with a negative dividend retains the sign of the dividend. Therefore, when you compute -4 % 7, the result will be -4
@College_era69
@College_era69 2 күн бұрын
kya GOD ho yar ap maja hi ajjata hai..i pick question from striver sheet and if smj ni atta to try finding ur soln ki kya apne same questn pe soln banaya hai if yes toh phle mai apka dkhta thnkeww mikkuu bhiayaaa love uu
@codestorywithMIK
@codestorywithMIK 2 күн бұрын
🙏🙏🙏❤️❤️❤️
@abhishek_jha28
@abhishek_jha28 3 минут бұрын
Absolutely wow explanation
@raihanulalamhridoy4714
@raihanulalamhridoy4714 Жыл бұрын
A lot of effort was put into this video. Thank you for the explanation!
@Shivanai_h
@Shivanai_h 10 ай бұрын
Best explanation on youtube.. please keep uploading solution with awesome explanation like this:)
@codestorywithMIK
@codestorywithMIK 10 ай бұрын
Thank you so much 😇❤️🙏
@amangoyal1600
@amangoyal1600 7 ай бұрын
Good Explained 😊
@chaitanyakarthikbasva
@chaitanyakarthikbasva Жыл бұрын
Awesome explanation, and you were right, only you explained the root reason behind everything in the approach, huge love from south india
@codestorywithMIK
@codestorywithMIK Жыл бұрын
So nice of you Thank you 🙏😇❤️
@itsaayush7357
@itsaayush7357 9 ай бұрын
Bro , your neat code, your clear voice explaination, and your pure intention to make us learn is just unmatchable! There are very few people at you tube jo itna shiddat se pdate he. Hatts off bro! Thank youuu🫂
@codestorywithMIK
@codestorywithMIK 9 ай бұрын
Means a lot. Thank you so much 🙏🙏❤️❤️
@divyasain15
@divyasain15 3 ай бұрын
best explanation 🙌🙌
@deeparawat8308
@deeparawat8308 Жыл бұрын
Very nice and detailed approach✨ Very helpful! Thank you👍
@AnandKumar-kz3ls
@AnandKumar-kz3ls Жыл бұрын
the way you explain how to tackle with negative remainder is just awesome bro respect++
@zhunzargulhane6741
@zhunzargulhane6741 9 ай бұрын
what awesome yaar, how did he considered 7n-4 that is still not clear. Could you please explain from where this n is coming.
@Akash-yr2if
@Akash-yr2if Жыл бұрын
Took around 1.5 hours to understand but finally it got inside my head, Thanks mate. Ye sum agar placement ka puch jarur batunga.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you 😊 ❤️
@udaytewary3809
@udaytewary3809 Жыл бұрын
You are awesome bhaiya I already solve the question using the map but your explanation comes like cherry 🍒 on top and by that my understanding towards the question increases to 10 times and for that really thankyou bhaiya really thankyou
@mewaconite
@mewaconite Жыл бұрын
big respect for you brother, good explanation, quality video ! please continue your DSA series as well.
@kartikkk4583
@kartikkk4583 Жыл бұрын
best video bro dayum
@tangududwarika4243
@tangududwarika4243 Жыл бұрын
Insane explanation just subscribed the channel
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you so much 😇🙏❤️
@tutuimam3381
@tutuimam3381 Жыл бұрын
Thanks a lot 3 approaches 🔥🔥🔥
@curtdudeanmol9393
@curtdudeanmol9393 Жыл бұрын
your channel is going to grow , best of luck , well explained
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Anmol ❤️
@niteshk0487
@niteshk0487 Жыл бұрын
mind blowing brdr👌✅
@priyanshkumar17
@priyanshkumar17 3 ай бұрын
Splendid Explanation Bhaiya !! Thanks & keep uploading such videos !! All the best to you😊😊😊😊🔥🔥
@utkarsh9233
@utkarsh9233 Жыл бұрын
wonderful explanation
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you 😇🙏
@nisargbarot1998
@nisargbarot1998 Жыл бұрын
Bhai superb explaination!!!
@pankajsuryavanshi8332
@pankajsuryavanshi8332 Жыл бұрын
Bro I am addicted to your channel Day by day.what a explanation brute force code explain then code submit then Explain TLE and again optimise approach.no one is teaching from that much depth
@pankajsuryavanshi8332
@pankajsuryavanshi8332 Жыл бұрын
Bro u can make more views if u show java code as well like just see striver video.its suggestion
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Sure Pankaj. I will try that too soon. Thanks a lot for your kind words
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Sure Pankaj. I will try that too soon. Thanks a lot for your kind words
@robot3.077
@robot3.077 3 сағат бұрын
means remainder is (sum%k+k)%k for both positive and negative
@Music-tp8gg
@Music-tp8gg Жыл бұрын
Next level explanation
@shreyasharma7987
@shreyasharma7987 3 ай бұрын
You explain so well!!! Thanks a lot.
@yashgaur2470
@yashgaur2470 Жыл бұрын
Great Explanation sir!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
It means a lot. Thank you 😇❤️
@altafmazhar7762
@altafmazhar7762 Жыл бұрын
29:54 great job bro this is what we want
@Akashkumar_12
@Akashkumar_12 3 ай бұрын
very good explanation thank you bhaiya
@Faiyaz__Ansari
@Faiyaz__Ansari Жыл бұрын
Amazing explanation of concepts step by step! Literally the best on KZbin!! 1M zyada door nahi
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Means a lot. Thank you so much 😇🙏
@aftereffectstraining7668
@aftereffectstraining7668 Жыл бұрын
thank you! big fan of your explanation
@kumarsaurabh5449
@kumarsaurabh5449 Жыл бұрын
always waiting for you video .best teacher in yt..😀😀😀
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Saurabh ❤️❤️❤️
@lokeshgoswami3748
@lokeshgoswami3748 Жыл бұрын
best teacher ,
@_hulk748
@_hulk748 Жыл бұрын
Thankyou sir understood 🙇‍♂🙏❤
@codestorywithMIK
@codestorywithMIK Жыл бұрын
So glad to hear ❤️❤️❤️
@TUSHARJAIN-gv4fi
@TUSHARJAIN-gv4fi Жыл бұрын
Great Work
@ispyu1514
@ispyu1514 Жыл бұрын
Great explanation!
@nikhilhaspe2734
@nikhilhaspe2734 3 ай бұрын
Hi Sir, Brute force will be of O(n^2) not O(n^3) as you said at 04:49 Code: class Solution { public int subarraysDivByK(int[] nums, int k) { int sum, count=0; for(int i=0; i
@bhaktisharma9681
@bhaktisharma9681 3 ай бұрын
thank you so much for this!!
@JJ-tp2dd
@JJ-tp2dd Жыл бұрын
mza aa gya bhai..thanks
@Bankruptcoder786
@Bankruptcoder786 5 ай бұрын
thank you boss
@AryanMishra-yh4ic
@AryanMishra-yh4ic Жыл бұрын
well explained
@shashankvashishtha4454
@shashankvashishtha4454 8 ай бұрын
moj karadi sir.
@anubhavsingla3126
@anubhavsingla3126 Жыл бұрын
I tried this approach in my first attempt void solve(vector& nums, int index, vector& temp) { if(index == nums.size()) return; vector ans; for(int i=index; i
@NatureLover-oq6uc
@NatureLover-oq6uc Жыл бұрын
Nice explanation sirji.....its a request plzz try to make videos little short....you would see a lot increase in no. of views on your channel.....btw thanks
@letsgazestar
@letsgazestar Жыл бұрын
Hidden Gem .
@dhairyachauhan6622
@dhairyachauhan6622 Жыл бұрын
A slightly better approach o(n2) whithout using prefix array the idea is to calculate the sum while building the subarrays class Solution { public: int subarraysDivByK(vector& nums, int k) { int n = nums.size(); int ans = 0; for(int i = 0;i
@priyanshkumar17
@priyanshkumar17 3 ай бұрын
Yes, I also did the same
@03_utpallucky40
@03_utpallucky40 Ай бұрын
iska mtlb jahan bhi subarray ki bat ho aur k diya ho divisible jaisa kch modulo baba ki jai ho soch skte .Crrct me if i am wrong.
@gauravbanerjee2898
@gauravbanerjee2898 3 ай бұрын
Thank you so much bhaiya ❤❤
@inglevivek8351
@inglevivek8351 4 ай бұрын
goat explanation
@santoshpathak8201
@santoshpathak8201 8 ай бұрын
Please Provide a Video on KMP and Z-Algorithm . We will be thankful
@codestorywithMIK
@codestorywithMIK 8 ай бұрын
KMP - kzbin.info/www/bejne/p5LWlqZjbsyCps0si=WDpG81RfsXWdXUX1
@ravicharan6568
@ravicharan6568 Жыл бұрын
Thanks a lot!
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thank you for watching 😇🙏
@vaibhavjain709
@vaibhavjain709 Жыл бұрын
Good job man.
@abhinay.k
@abhinay.k Күн бұрын
thanks
@shabananoor9423
@shabananoor9423 Жыл бұрын
3 ways 🔥🔥🔥
@aws_handles
@aws_handles 6 ай бұрын
This is lit 👌🏻👌🏻👌🏻
@EB-ot8uu
@EB-ot8uu 6 ай бұрын
Best.
@hackingkingdom5634
@hackingkingdom5634 3 ай бұрын
Op Explanation sir
@a3rdtierguy864
@a3rdtierguy864 3 ай бұрын
Due to this negative remainder edge case i am unable to pass all testcases .
@DevOpskagyaan
@DevOpskagyaan 3 ай бұрын
Mast ❤
@SatyamYadav-oz5ge
@SatyamYadav-oz5ge 3 ай бұрын
bhaiya make videos on lc 401 and biweekly 132 (3rd and 4th one) dp
@Momentsofmagic28
@Momentsofmagic28 3 ай бұрын
Thanks a lot
@molyoxide8358
@molyoxide8358 Жыл бұрын
This line 29:53 shows your Patience level bro.
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot ❤️
@wearevacationuncoverers
@wearevacationuncoverers Жыл бұрын
true
@karthikeysharma9161
@karthikeysharma9161 Жыл бұрын
🔥
@pritishpattnaik4674
@pritishpattnaik4674 Жыл бұрын
mein pehele try kiya aur n^2 solution hi likh paya then saw ur video , awesome explanation sir!! My Approach int subarraysDivByK(vector& nums, int k) { //O(n^2) int ans = 0; for (int i=0 ; i
@codestorywithMIK
@codestorywithMIK Жыл бұрын
Thanks a lot Pritish. And I am so glad you tried O(n^2) on your own first. Way to go 💪💪💪
@TusharRaja3009
@TusharRaja3009 3 ай бұрын
maine brute force try kia, usme kewal 70 testcase pass hua and then tle aya. Can you make a video about what are importance of constraints.. and how to decide that as per constraint which which O() or bigOmega will be accepted... becoz i thought that 10^8 cycle per second is allowed , and in question we had Constraint that n is within 3x10^4... so i thought 10^4 ka square means 10^8 tak toh chalna chahiye tha means O(n square) chalna chahiya tha but nahi chala ... plzzz ispe video banao na..explaining these complexities(sorry for typos)
@Lakshya-f4l
@Lakshya-f4l 3 ай бұрын
Thank you !
@aizad786iqbal
@aizad786iqbal 3 ай бұрын
Hey MIK Longest subarray with sum divisible by K can u please make a video on this topic in your free time .. it should be based on similar logic right ?
@dibbodas4116
@dibbodas4116 3 ай бұрын
if remainder is negative why we adding k rather than any number? modulo + k wala part hard hea
Find the Town Judge | 2 Approaches | Leetcode 997
10:43
codestorywithMIK
Рет қаралды 5 М.
Variable Size Sliding Window | Largest Subarray of sum K | Part1
25:05
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 55 МЛН
ЭТО НАСТОЯЩАЯ МАГИЯ😬😬😬
00:19
Chapitosiki
Рет қаралды 2,2 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 18 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 72 МЛН
Subarray Sums Divisible by K - Leetcode 974 - Python
16:41
NeetCodeIO
Рет қаралды 16 М.
Longest subarray with sum divisible by K | GfG problem of the day
16:48
Code with Alisha
Рет қаралды 11 М.
Subarray Sum Equals K - Prefix Sums - Leetcode 560 - Python
15:19
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 55 МЛН