752. Open the Lock | BFS | Graph | Time Complexity | Why not DP?

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

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 37
@shivchauhan795
@shivchauhan795 7 ай бұрын
Hey don't get demotivated. You really explain all the questions in very good way. From last 2 month i'm daily watching your videos whenever I get doubt while solving daily leetcode question. Your dedication of how you record the videos early morning with such a great explanation is unbelievable. Keep up the good work. You will surely get reach with this consistency. Looking forward to meet you some day, it will be nice.
@sarthakrana5658
@sarthakrana5658 7 ай бұрын
"Lavel sbke niklenge" .... Good use of meme 😂
@codingkart245
@codingkart245 7 ай бұрын
BROO!!! YOU JUST KILLED IT!!!! Keep making videos like this!!
@Jazzimus
@Jazzimus 7 ай бұрын
bhaiya aap goated ho never forget
@tusharsinghal1333
@tusharsinghal1333 7 ай бұрын
You are putting so much effort in these videos. keep up the good work bro.
@bhavaygoel
@bhavaygoel 7 ай бұрын
ive not seen any channel put that much effort everyday. keep up the work bro!
@tusharsinghal1333
@tusharsinghal1333 7 ай бұрын
The internal while loop for each level seemed a little confusing to me, so i did it a little differently by making a queue of pair which keeps a pair of {currentString, level} and that did the job in a single while loop, similar to traditional BFS.
@kiranjeetkaur4955
@kiranjeetkaur4955 7 ай бұрын
Awesome.. idk why you get very less likes.. you deserve a lot more
@shreejeshjballal767
@shreejeshjballal767 7 ай бұрын
Great Explanation ✨.Thank you!
@yashyenurkar9383
@yashyenurkar9383 7 ай бұрын
great solution and explanation🙌
@wilhelmrudolphfittig3577
@wilhelmrudolphfittig3577 5 ай бұрын
good keep it up !
@niteshkhanna690
@niteshkhanna690 7 ай бұрын
Your code is very clean and clear
@vanshikaahuja766
@vanshikaahuja766 7 ай бұрын
ngl, You are my inspiration.
@sameera2426
@sameera2426 7 ай бұрын
great explanation
@ShubhamMIshra-hv5nz
@ShubhamMIshra-hv5nz 7 ай бұрын
I love your videos Aryan, i watch it on a daily basis.
@shubham_paliwal
@shubham_paliwal 7 ай бұрын
Thanks a ton for making us understand in the best possible way! 💯...It takes a lot of efforts, guts, and a very deep understanding to do so 🔥.
@akasakasad
@akasakasad 7 ай бұрын
keep up the good work my man
@harshal8781
@harshal8781 7 ай бұрын
❣💞❣
@vickyroy3595
@vickyroy3595 7 ай бұрын
100k soon!!!!❤
@rahulsihara8946
@rahulsihara8946 7 ай бұрын
Amazing explanation as always
@asthajain2511
@asthajain2511 7 ай бұрын
great content 😌
@Noob_Coder1234
@Noob_Coder1234 7 ай бұрын
TIME AND SPACE COMPLEXITY PART WAS LIT!!
@k.satish3663
@k.satish3663 7 ай бұрын
Nice explanation.
@Vishal-qb3wz
@Vishal-qb3wz 7 ай бұрын
Great Content. Keep Doing!!!!
@mathy642
@mathy642 7 ай бұрын
nice explanation!!
@nagasrisaichaitanyakolluri8173
@nagasrisaichaitanyakolluri8173 7 ай бұрын
Thanks bro
@HaiAnhDuong-ew2fl
@HaiAnhDuong-ew2fl 7 ай бұрын
nice bro
@bharatmehta30
@bharatmehta30 7 ай бұрын
Level sabke niklenge.
@kuldeepsaini460
@kuldeepsaini460 7 ай бұрын
Great Explanation please open a Hindi Channel also
@TON-108
@TON-108 7 ай бұрын
Lyaval sabke nikalenge 😌😌😌
@shreeshdivyamsinha126
@shreeshdivyamsinha126 7 ай бұрын
Yrr aap itna mehnat kar rahe ho. App j curve ke starting pe ho bas kuch din aur, aap dekhna 100k bahut jald hojayga. 🙂
@ujjwalrockriser
@ujjwalrockriser 7 ай бұрын
Sorry, bas BFS dekha aur video nahi dekha, thank you for the hint.
@jiganeshpatil1472
@jiganeshpatil1472 7 ай бұрын
Leavaaal sabke niklenge
@nerdInsaan
@nerdInsaan 7 ай бұрын
Java code for reference : class Solution { public char turnRight(char c){ return c == '9' ? '0' : (char) ( c + 1); } public char turnLeft(char c){ return c == '0' ? '9' :(char) ( c - 1); } public List nextOptions(String s){ List options = new ArrayList(); for(int i = 0 ; i < 4 ; i++ ){ char [] copy = s.toCharArray(); copy[i] = turnRight(s.charAt(i)); options.add(new String(copy)); copy[i] = turnLeft(s.charAt(i)); options.add(new String(copy)); } return options; } public int openLock(String[] deadends, String target) { Deque q = new LinkedList(); Set visited = new HashSet(); q.offer("0000"); visited.add("0000"); Set deadend = new HashSet(Arrays.asList(deadends)); int level = 0; while(!q.isEmpty()){ int size = q.size(); while(size-- > 0){ String curr = q.poll(); if(curr.equals(target)) return level; if(deadend.contains(curr)) continue; for(String option : nextOptions(curr)){ if(!visited.contains(option) && !deadend.contains(curr) ){ q.offer(option); visited.add(option); } } } level++; } return -1; } }
@wellsonny7987
@wellsonny7987 6 ай бұрын
CFBR
@shashanksahu9230
@shashanksahu9230 7 ай бұрын
At first I thought It was a recursion problem, but I was getting wrong answer with it. I still don't understand how you come up with graph instead of recursion
@Helop538
@Helop538 7 ай бұрын
Again
Open the Lock - Leetcode 752 - Python
14:22
NeetCode
Рет қаралды 41 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 118 МЛН
УДИВИЛ ВСЕХ СВОИМ УХОДОМ!😳 #shorts
00:49
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
Graph Search Algorithms in 100 Seconds - And Beyond with JS
10:30
Static Compilation of Julia with Jeff Bezanson
1:01:41
Julia Dispatch
Рет қаралды 1,6 М.
The hidden beauty of the A* algorithm
19:22
Polylog
Рет қаралды 900 М.
739. Daily Temperatures | Monotonic Stack | Space Optimisation O(1)
28:11
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 118 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 150 М.
LeetCode Open the Lock Solution Explained - Java
15:35
Nick White
Рет қаралды 21 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 199 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 118 МЛН