279. Perfect Squares | 5 Ways | DP | Math | BFS | Lagrange & Legendre Theorem | Top-Down | Bottom Up

  Рет қаралды 5,255

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер
@thefinestmeme3317
@thefinestmeme3317 7 ай бұрын
oh my god you are absolutely amazing
@RishiRajMusa
@RishiRajMusa 6 ай бұрын
I remembered my 12th math class, you are amazing.
@nooob_coder
@nooob_coder Жыл бұрын
most complete channel...come up with dsa series
@hajikhalil4268
@hajikhalil4268 4 ай бұрын
I'm impressed with the way you explain the problem :)
@pratik5756
@pratik5756 Жыл бұрын
one of the most underrated DSA channel. keep up the good work bro!!!!
@cybermonkey2807
@cybermonkey2807 Жыл бұрын
I have a feeling...you are gonna blow up on youtube very soon god bless.
@gamenotover1600
@gamenotover1600 Жыл бұрын
yo ,your pfp is same as my phone's wallpaper...Big fan of cowboy bebop
@arastusharma439
@arastusharma439 Жыл бұрын
Awesome Explanation bro !! The math behind the theorem you explained it very well !! 👋👌✌
@ritikrajprasad2407
@ritikrajprasad2407 Жыл бұрын
Just some doubt, if we are continuously dividing n by 4 and then the resultant is getting stored in n then the for loop is being run through that "modified" value of n, which would have a different square-root value than the actual n, then why even after this modification, we are getting the correct answer!!
@satwiktatikonda764
@satwiktatikonda764 Жыл бұрын
the only one channel wch discuss abt all the approaches
@bharatmehta30
@bharatmehta30 Жыл бұрын
Great explaination bhai. Thank you for doing beautiful work.
@pawanmalik2998
@pawanmalik2998 Жыл бұрын
we can also solve this problem using coin change approch .... just find max possible number which square is less or equal to n then use coins i as (i*i) range from 1 to max possible number which square is less or equal to n
@rajrajesh1669
@rajrajesh1669 Жыл бұрын
Yes but that will not be the most efficient approach though, If we're on the same page, It will be a 2-d Dp solution right? But it will not throw TLE either...
@debabratagon7289
@debabratagon7289 Жыл бұрын
Nice explanation bro
@me-16ayushverma40
@me-16ayushverma40 Жыл бұрын
these two theorem are life saver😅
@meetpalsingh2933
@meetpalsingh2933 Жыл бұрын
Was fast-paced, but nice explanation. Confused the hell out of me when you highlighted the node of 3rd depth instead of 4th.
@kannank4269
@kannank4269 Жыл бұрын
for checking whether it is i^2 + j^2 + k^ 2 = N, we can i and j uptill cube root of N, we can find k using i, j, N. this also works right?
@debabratagon7289
@debabratagon7289 Жыл бұрын
In the Math technique While explaining the theory you used the condition of 2 first hence it was justified to use the condition 4 next (as it is the only option left) but in the code you wrote the condition of 4 first then 2 . how is it justified?
@abhinay.k
@abhinay.k Жыл бұрын
thanks
@gyaniyoda4608
@gyaniyoda4608 Жыл бұрын
wow
@harshal8781
@harshal8781 Жыл бұрын
aryan bhai i 1st wrote top-down approach it gave TLE and when I converted it to bottom up it passed all the TC and got accepted too. But as you mentioned both have the same TC and SC so how its possible?
@me-16ayushverma40
@me-16ayushverma40 Жыл бұрын
bhaiya from where u know abt this theorem....
@joydeeprony89
@joydeeprony89 Жыл бұрын
bro one suggestion go little slow
@cursed_nerd
@cursed_nerd Жыл бұрын
Use 0.75x
@samagraagrawal5333
@samagraagrawal5333 Жыл бұрын
Does the interviewer expects us to know these theorems?
@rajrajesh1669
@rajrajesh1669 Жыл бұрын
I think no... Not every problem can be solved using theorems, But when we have a choices based problem and if we can break a bigger problem into sub problems then DP works for everything. I think, for this problem, 1D dp solution is more than enough.....
@harshal8781
@harshal8781 Жыл бұрын
@@rajrajesh1669 agreed :)
310. Minimum Height Trees | BFS | Topological Sort | Graphs
24:47
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
3448. Count Substrings Divisible By Last Digit | 3D DP | With Dry Run
33:40
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
C can do this too and it's faster than Python
2:09:48
Tsoding Daily
Рет қаралды 17 М.
Perfect Squares - Dynamic Programming - Leetcode 279 - Python
15:12