Longest Subarray with Equal 0s 1s and 2s | Hashmap Interview Questions Playlist

  Рет қаралды 10,306

Pepcoding

Pepcoding

Күн бұрын

Пікірлер: 28
@souravsingha5776
@souravsingha5776 2 күн бұрын
Sir your teaching quality is ❤❤❤❤❤ I can't explain with any word. I couldn't stop myself from commenting. Sir please take my Bow🙏
@mayank_singh_43
@mayank_singh_43 3 ай бұрын
saluting sir for your contents
@tanishkumar6682
@tanishkumar6682 Жыл бұрын
understood
@AshishChourasia1996
@AshishChourasia1996 4 жыл бұрын
Crystal clear explanation sir!!
@Pepcoding
@Pepcoding 4 жыл бұрын
Glad to hear that
@kanavchopra7333
@kanavchopra7333 3 жыл бұрын
You are a great explainer sir. Glad you are posting on YT
@tejveersingh3672
@tejveersingh3672 3 жыл бұрын
Sir amazing explanation. You make all these loigcs very easy and interesting. I enjoy them alot :))
@Pepcoding
@Pepcoding 3 жыл бұрын
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review g.page/Pepcoding/review?rc You can subscribe to our channel here kzbin.infoabout?view_as=subscriber
@vishwassahu
@vishwassahu 2 жыл бұрын
eezafa what a touch...😫😫
@varunmanchanda3972
@varunmanchanda3972 4 жыл бұрын
Sir you are doing great work, thanks for that:)
@Pepcoding
@Pepcoding 3 жыл бұрын
Thank you
@aman6561
@aman6561 3 жыл бұрын
delta21 ,delta10 inhi ka khela tha pura or baaki key bnane ka.
@nitinkumar5974
@nitinkumar5974 3 жыл бұрын
Amazing explanation 🔥🔥
@AnkitSingh-xp7mm
@AnkitSingh-xp7mm 3 жыл бұрын
We can also replace all zero's with -3, then generate a prefix sum. After that, this problem is similar to - longest subarray with equal 0s & 1s.
@raghavgarg8024
@raghavgarg8024 3 жыл бұрын
what if n=4 arr=1,0,1,1 is this approch works now??
@AnkitSingh-xp7mm
@AnkitSingh-xp7mm 3 жыл бұрын
@@raghavgarg8024 There are two cases based on prefix sum: 1.) When we get prefix[I] == 0 2.) When prefix[I] == prefix[j] In both cases, we can check the number of elements(Subarray) should be multiple of 3: 1.) number of subarray elements = i+1 2.) number of subarray elements = j-i
@jatinbhatoya8420
@jatinbhatoya8420 2 жыл бұрын
@@AnkitSingh-xp7mm i like your approach. i thought same like you
@sakshamp4488
@sakshamp4488 Жыл бұрын
is this question avilable on leetcode for submission?
@jatinbhatoya8420
@jatinbhatoya8420 2 жыл бұрын
sir isme hum aise nhi krr skte ki like hum 0=-1 maan le and 1=0 and 2=1. aur uske baad agar 0 sum repeat hua toh mil jayega subarray
@Pepcoding
@Pepcoding 2 жыл бұрын
For better insight, visit nados.io, post your doubts, community will help you out there.
@biswajitsingh8790
@biswajitsingh8790 2 жыл бұрын
Ye bhi sahi hai yaar. Chalna chahiye isse bhi.
@ps6846
@ps6846 2 жыл бұрын
If there is only 111 then also sum will be 0.
@araragikoyomi7186
@araragikoyomi7186 2 жыл бұрын
When will I able to think the solutions of this types of problem by myself I practiced so much questions then too I didn't able to solve this on my own. But I like your approach I and got the intuition.
@Pepcoding
@Pepcoding 2 жыл бұрын
Keep on practicing. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@rajatsharma6137
@rajatsharma6137 2 жыл бұрын
With practice...keep trying questions on your own...avoid solutions...you mind muscles will develop eventually...all the best
@aditikajale8514
@aditikajale8514 3 жыл бұрын
Can we just take count of 0 1 2 in map?
@souravjha8244
@souravjha8244 3 жыл бұрын
can you tell me how to implement the delta function for an equal number of 0s and 1s or any other method is there to find an equal number of 0s and 1s??
@Pepcoding
@Pepcoding 3 жыл бұрын
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,2 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
Contiguous array | Leetcode #525
13:12
Techdose
Рет қаралды 55 М.
SHAPALAQ 6 серия / 3 часть #aminkavitaminka #aminak #aminokka #расулшоу
00:59
Аминка Витаминка
Рет қаралды 2,2 МЛН