3130 & 3129 Find All Possible Stable Binary Arrays II | DP | Prefix Sums | Sliding Window

  Рет қаралды 4,246

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 26
@salmankhader1258
@salmankhader1258 6 ай бұрын
58 mins is worthy to watch it.
@ARYANMITTAL
@ARYANMITTAL 6 ай бұрын
If we have any doubts on dp problem on Intuition or understanding, do watch this playlist for practice - kzbin.info/aero/PLEL7R4Pm6EmCXe8803IBAPWVsHlTVrtOp . . How all Educators are lying to you - kzbin.info/www/bejne/hnjUgH2iq5WJm7s
@JRK_RIDES
@JRK_RIDES 6 ай бұрын
Pin this comment
@nikhiljain8303
@nikhiljain8303 6 ай бұрын
The video for which we were waiting. Thanks @aryan
@gaurish3367
@gaurish3367 5 ай бұрын
amazing video
@Manjeet-zz1wi
@Manjeet-zz1wi 6 ай бұрын
Great video sir . It's really awesome to see alumni sharing their expertise.
@killeraloo3247
@killeraloo3247 6 ай бұрын
sab samjh aa gya, accha solution tha.
@242deepak
@242deepak 6 ай бұрын
I am not an english expert but improvisation means making something on the spot and improvement means to improve something. Both are not the same.
@nikhilprakash729
@nikhilprakash729 6 ай бұрын
great explanation
@mayankkharb4164
@mayankkharb4164 6 ай бұрын
@ARYANMITTAL great video brother. Just a single doubt, in this we are using the prefix concept some people have used a different prefix space to store the prefixes but you made the specific dp state itself as the prefix value by adding it's previous state into it, but when giving the final answer you are returning the dp state itself which is a prefix of dp states till that point, shouldn't you subtract the previous state from it so it isn't the prefix state anymore and then return it? Also, i am saying convert it into prefix because in the non-optimal tabulation method you are only adding the alternate 0 or 1 state to add into current state but in the optimal one at the start only you are adding the same 0 or 1 previous state into it which makes it the prefix state till then.
@sukhpreetsingh5200
@sukhpreetsingh5200 6 ай бұрын
bhai awesome explaination
@VivekKumar-p2g4l
@VivekKumar-p2g4l 6 ай бұрын
the optimization from o(n^3) to O(n^2) was difficult to understand
@sushanthgupta626
@sushanthgupta626 6 ай бұрын
How can this question be done in 1 hr 😶😶😶.... HOw to get intution... then optimize... then solve to in just 1hr.. how??
@helloimjavauser
@helloimjavauser 6 ай бұрын
On which writing pad do you write?
@coder6109
@coder6109 6 ай бұрын
dont ever stop bro
@Krishna-ti8ys
@Krishna-ti8ys 6 ай бұрын
Hi @ARYANMITTAL thanks for the solution, I am facing an issue that when i make dp of type dp[zero][one][consecutiveEl][cnt], my solution gets sumitted but when i use dp of type dp[zero][one][cnt][consecutiveEl] it gives tle. Is this some kind of glitch of leetcode as the time complexity of both the type is same. I am very confused.
@akashkaruturi5128
@akashkaruturi5128 6 ай бұрын
if you are using python it will give
@Krishna-ti8ys
@Krishna-ti8ys 6 ай бұрын
@@akashkaruturi5128 I have written my code in c++.
@anonymous10906
@anonymous10906 6 ай бұрын
same problem here with c++
@Krishna-ti8ys
@Krishna-ti8ys 6 ай бұрын
@@akashkaruturi5128 I have written my code in c++
@shivrajhulwan2235
@shivrajhulwan2235 6 ай бұрын
Yes I also faced same issue in the contest
@rkb_404
@rkb_404 6 ай бұрын
why not dp[z - limit][o][1] instead of dp[z - limit - 1][o][1]? Still not able to grasp it
@akashmaurya6313
@akashmaurya6313 6 ай бұрын
simply bcz we are counting from limit to z-1. for ex - let's say limit is 1 so if we do dp[z - limit][o][1] this means dp[z -1][o][1] but since our limit is 1 that means we have consider 1 previous element then we should do dp[z -2][o][1] instead of dp[z -1][o][1] this is why dp[z - limit - 1][o][1]
@QWERTY-ee2ys
@QWERTY-ee2ys 6 ай бұрын
Bhai normally explain nahi kar sakta kya? It annoying at times the over exaggeration. Aur tune hi ye problem ka video dala hai so got no option. Anyways good content
@govindlohar6816
@govindlohar6816 6 ай бұрын
this code is not getting pass with java
@SiddharthSingh-ty3xz
@SiddharthSingh-ty3xz 6 ай бұрын
Giving TLE for last 2 test case
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 34 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 6 МЛН
PIZZA or CHICKEN // Left or Right Challenge
00:18
Hungry FAM
Рет қаралды 15 МЛН
Which team will win? Team Joy or Team Gumball?! 🤔
00:29
BigSchool
Рет қаралды 15 МЛН
BUILDING A NOTE TAKING APP PART - 6
ezLive
Рет қаралды 132
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 34 МЛН