Тёмный
Time Complexity Infinity
Time Complexity Infinity
Time Complexity Infinity
Подписаться
I am coding through the Leet Code top 100 liked questions with solutions and explanations. Lets solve some problems!
Комментарии
@brobro8471
@brobro8471 Месяц назад
Solution : 1. Add all of the opens, then add all of the closes. This produces the first combination. 2. Remove characters from the string until we find an opening parenthesis. Remove the opening parenthesis and check whether close < open. 3. If close < open, add a closing parenthesis to the string. Next, add the remaining opens, then add the remaining closes. Repeat step 2. If close >= open, repeat step 2
@lamaalnajjar1003
@lamaalnajjar1003 8 месяцев назад
great explanation !
@zukoric
@zukoric 9 месяцев назад
Great job, nobody explains like you do on YT
@karanchandramandi1967
@karanchandramandi1967 10 месяцев назад
Thanks man for explaining that recursive tree as well as code explanation.
@udaykulkarni5639
@udaykulkarni5639 11 месяцев назад
Woww!! M gonna remember this for the rest of my life!
@tirthshah8550
@tirthshah8550 Год назад
What is the space complexity for this
@StyleTrick
@StyleTrick Год назад
Great solution and thinking, thanks!
@aniruddhashahapurkar9244
@aniruddhashahapurkar9244 Год назад
Best explanation!!
@效应多普勒
@效应多普勒 Год назад
Wow, truly the best explanation of this topic
@sophiaj6810
@sophiaj6810 Год назад
It would be nice if you have java and python verison.
@vijayakumareyunni6010
@vijayakumareyunni6010 Год назад
Good explanation. Thank you
@arrows8367
@arrows8367 Год назад
An excellent teacher ❤
@prakashgatiyala9869
@prakashgatiyala9869 Год назад
😇
@joseulissescastro4883
@joseulissescastro4883 Год назад
That was the only video that helped me to really understand what happens in a backtracking solution. Thank you sir
@saelkhlouf1695
@saelkhlouf1695 Год назад
Man you are a life saver !
@010101dddm
@010101dddm Год назад
best explanation on youtube hands down
@Zoe-fw6kt
@Zoe-fw6kt Год назад
please start posting new videos, I watched loads of algothrim videos, yours are the ones that make more senses. and easier to understand, Thank you~~~
@DJSamijon
@DJSamijon Год назад
i love that you did it in the execution order
@ShubhamKumar-sj6dp
@ShubhamKumar-sj6dp Год назад
this is the best illustration for recursion tree when called under a loop, every video just draw a two way or three way branch from beginning but this was exactly step by step , thnx
@riturathinsharma5931
@riturathinsharma5931 2 года назад
O(n!)
@soldiers4838
@soldiers4838 2 года назад
hello sir i have a problem regarding making combination can you solve it please
@LTZMSYAL
@LTZMSYAL 2 года назад
great job thank's that was clear!
@soninirav
@soninirav 2 года назад
Keep going man....your explanation skills are just awesome :)😃
@kewtomrao
@kewtomrao 2 года назад
Awesome explanation sir. Thanks for this!
@Chloe-si2hq
@Chloe-si2hq 2 года назад
Thank you for your patience and hard work for actually walking us through the recursive process. The recursion tree is clear and solid. You really know what you are teaching unlike most of the LeetCode RU-vidr out there who only copy and paste code. Thanks again!
@zidane6165
@zidane6165 2 года назад
Read the way of solving it using GeeksForGeeks, AlgoExpert, Leetcode prime solution explanation, couple of youtube videos. Didn't understand it from any, but you. Thank you.
@navderm
@navderm 2 года назад
the removal of one element from an array itself is an O(n) complexity. That turns your solution into O(n*n*(n!))
@mistercorea
@mistercorea 2 года назад
What if you use a splice() function that will be O(1)? can you explain why it is O(n^2 * n!)?
@navderm
@navderm 2 года назад
@@mistercorea How does splice work internally? How do you say that splice is an O(1) algorithm? Splice itself cannot be O(1) but at the minimum has to be O(n).
@dhillon6449
@dhillon6449 2 года назад
the best
@aadil4236
@aadil4236 2 года назад
Jesus, what an underrated video. Thank you so much, mate!!
@soumikkarmakar7433
@soumikkarmakar7433 2 года назад
No one cared to explain how recursion is working inside the for loop. But you did it thanks a lot man!!
@spicytuna08
@spicytuna08 2 года назад
nice
@danishuddin9752
@danishuddin9752 2 года назад
Thank andi guru garu, ee logic ardham kaaka oka roju antha chacchi poya!
@admercs
@admercs 2 года назад
Nice explanation!
@krugerbrent4270
@krugerbrent4270 2 года назад
Wow! You did a phenomenal job of explaining this in much simpler terms. Thank you so much for making this. Now, I understand this problem way better. I have one question though - Isn't the time complexity O(n * n!) from the tree diagram you illustrated? n times we are doing n! right, or can we reduce O(n * n!) to O(n!)?
@marktheimmortal
@marktheimmortal 2 года назад
Great explanation of the problem and solution! Nice one!
@prafullakh
@prafullakh 2 года назад
Today marks 3 years since you posted this video. Why have you stopped posting new videos? You are a very good teacher, Sir. You have a divine gift. Recursive thanks to you. PLEASE START POSTING NEW VIDEOS.
@ruixue6955
@ruixue6955 2 года назад
1:22 algorithm - 1:29 recursion 1:54 go through the recursion tree 2:40 11:46 code
@tonyz2203
@tonyz2203 2 года назад
no more updates? best video
@sanskarkaazi3830
@sanskarkaazi3830 2 года назад
Can somebody do this with java. ?
@quochunghoang8833
@quochunghoang8833 2 года назад
Wonderful recursive explanation !!! Thank you.
@princeagrawal7307
@princeagrawal7307 2 года назад
int findMaxLen(string s) { // code here stack<int>st; st.push(-1); int ans=0; for(int i=0;i<s.size();i++){ if(s[i]=='(')st.push(i); else{ st.pop(); if(st.empty()) st.push(i); else ans=max(ans,i-st.top()); } } return ans; }
@leohippochin708
@leohippochin708 3 года назад
This video is very well done. Good Job. Man!
@sumerindia89
@sumerindia89 3 года назад
The way you explain about call stack, this is appreciable.
@gurjotsinghsidhu1643
@gurjotsinghsidhu1643 3 года назад
Very nice explanation. Can someone show how to do write this in Python?
@saumyaranjannayak2101
@saumyaranjannayak2101 3 года назад
Awesome !
@oziomaogbe8665
@oziomaogbe8665 3 года назад
Love you bro
@roger_ramirez
@roger_ramirez 3 года назад
Best explanation I have watched. Thanks!
@yakovkemer5062
@yakovkemer5062 3 года назад
Very nice explanation. Time complexion will O(nm) where n is number of candidates and m is a target. You have 2 inputs. So first shit * second shit.
@philsousa
@philsousa 3 года назад
How do you do that call stack step by step thing? Are those just slides?
@joelcruz2873
@joelcruz2873 3 года назад
Great video!