Number of Ways to Reorder Array to Get Same BST II Pattern II Math II Combinatorics II Recursion

  Рет қаралды 7,245

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 35
@ARYANMITTAL
@ARYANMITTAL Жыл бұрын
Code & Notes: drive.google.com/file/d/1rsGuUwu-mWQT-I-oOvn6tctNc8McMJQZ/view?usp=sharing This is one of the best questions to use Combinatorics + Recursion 💪🙈 !!
@dhanashreegodase4445
@dhanashreegodase4445 Жыл бұрын
thanks aryan , you are the real gem:) your videos never disspoints, thanks for giving each minor details for evey problems.
@pokerfaced8139
@pokerfaced8139 Жыл бұрын
what a great intuition building, i m impressed.
@artistic__08
@artistic__08 Жыл бұрын
in all your videos you really put in a lot of effort. And you love to teach, clearly shows in the videos. Keep up the good work, I can see this channel become popular in future. Other channel don't explain intuition which makes this channel stand apart.
@shashankarora2945
@shashankarora2945 Жыл бұрын
Amazing explanation
@AnshulSharma-gq2vn
@AnshulSharma-gq2vn Жыл бұрын
Brilliant!! Keep Going!💪💪
@AnandKumar-qj2iy
@AnandKumar-qj2iy Жыл бұрын
i just saw your video for the first time and I loved it so much......great explanation!!!
@pranshu_awasthi
@pranshu_awasthi Жыл бұрын
GEM , ABSOLUTE GEM !
@arihantjainajbil8182
@arihantjainajbil8182 Жыл бұрын
very nice
@ShreyaMalik-1207
@ShreyaMalik-1207 Жыл бұрын
thankyou i was about to cry
@jagratgupta8392
@jagratgupta8392 Жыл бұрын
very nice problem.....understood the problem myself but couldn't understand that recursion will be used to solve subproblems.....great explaination sir
@anujgupta9081
@anujgupta9081 Жыл бұрын
man this is one of the best explanation I've ever seen, kudos!
@tejuschaturvedi6234
@tejuschaturvedi6234 Жыл бұрын
Your videos are always satisfyingly expalanatory . Never leave any doubt after completing the video .
@mukultaneja7243
@mukultaneja7243 Жыл бұрын
Thanks Aryan, for this great explanation. Can you please also explain this?: We have another formula to find nCr -> ""(n * (n-1) * (n-2) * ..... r times) / (r * (r-1) * (r-2) * .... 1)"". Why does using this formula give us the wrong answer? Thanks already.
@benoitblanc-zl8rc
@benoitblanc-zl8rc Жыл бұрын
Im pretty sure this was 2+ hrs of effort Massive respect
@yashagrawal1663
@yashagrawal1663 Жыл бұрын
wow
@RahulMaurya-tc2wi
@RahulMaurya-tc2wi Жыл бұрын
Java Code if anybody is struggling, class Solution { private long[][] table; public int numOfWays(int[] nums) { ArrayListlist=new ArrayList(); for(int x:nums) { list.add(x); } long mod = (long)1e9 + 7; int n = nums.length; table=new long[n+1][n+1]; for (int i = 0; i < n + 1; ++i) { Arrays.fill(table[i],1); for (int j = 1; j < i; ++j) { table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod; } } long ans = dfs(list, mod); return (int)((ans % mod - 1) % mod); } private long dfs(ArrayList nums,long mod) { int n = nums.size(); if (n
@067_ayushkarroy9
@067_ayushkarroy9 Жыл бұрын
Thanks bro
@gauravkungwani
@gauravkungwani Жыл бұрын
great explanation !!
@balmukundkanodia6776
@balmukundkanodia6776 Жыл бұрын
Amazing explanation. Thanks a lot!!
@rishijain8472
@rishijain8472 Жыл бұрын
understood in one go... Great Explanation
@rishabhgupta9846
@rishabhgupta9846 Жыл бұрын
Awesome explanation bro,bhai aise hi padhate raho
@snigdhobhattacharya4697
@snigdhobhattacharya4697 Жыл бұрын
Thank you for the amazing explanation!
@anzidd02091988
@anzidd02091988 Жыл бұрын
awesome man, especially at time 20:46, 😃
@Sakshi_6888
@Sakshi_6888 Жыл бұрын
Great Explanation, Thanks
@MP-ny3ep
@MP-ny3ep Жыл бұрын
Phenomenal explanation. I was having a hard time understanding the final formula but you explained it so good. Thank you . Please continue doing more videos.
@gouthamp9066
@gouthamp9066 Жыл бұрын
PYTHON: class Solution: def numOfWays(self, nums: List[int]) -> int: mod=10**9+7 def dfs(nums): if len(nums)nums[0]: right.append(num) else: left.append(num) left_poss=dfs(left) right_poss=dfs(right) n=len(nums) return ((comb(n-1,len(left))*left_poss)*(right_poss))%mod return dfs(nums)-1
@yogesh8526
@yogesh8526 Жыл бұрын
Awesome Explanation !!!
@rakeshydc4139
@rakeshydc4139 Жыл бұрын
Amazing Explanation brother! Didn't get confuse or bore even though it was Hard and 40 mins long
@thisismrsanjay
@thisismrsanjay Жыл бұрын
great work
@यात्रा-ङ4छ
@यात्रा-ङ4छ Жыл бұрын
return (((dp[n-1][len(left)] * left_perm) % mod )*right_perm) % mod is working but return ((dp[n-1][len(left)] * left_perm *right_perm) % mod isn't. If there any explaination please provide a response
@gauravkungwani
@gauravkungwani Жыл бұрын
in each step, you should take mod because the value can go out of range.
@yashagrawal1663
@yashagrawal1663 Жыл бұрын
Bhai why so about corporate life what happened?
@thiyaneswarana3656
@thiyaneswarana3656 Жыл бұрын
jyada overacting mat kar yaar
@amitbajpai6265
@amitbajpai6265 Жыл бұрын
Aryan bhai apko LISP hai ya acting karte ho ????
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
How to have fun with a child 🤣 Food wrap frame! #shorts
0:21
BadaBOOM!
Рет қаралды 17 МЛН
one year of studying (it was a mistake)
12:51
Jeffrey Codes
Рет қаралды 339 М.
The SHOCKING Truth About Who Should NOT Code! 🤫
11:50
Aryan Mittal
Рет қаралды 2,9 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 149 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 35 МЛН
Animation vs. Math
14:03
Alan Becker
Рет қаралды 80 МЛН
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 4,2 МЛН
One second to compute the largest Fibonacci number I can
25:55
Sheafification of G
Рет қаралды 477 М.
How to Stop Procrastinating and Finally Take Action
16:31
Ali Abdaal
Рет қаралды 115 М.