CLONE GRAPH | LEETCODE # 133 | PYTHON BFS SOLUTION

  Рет қаралды 3,585

Cracking FAANG

Cracking FAANG

Күн бұрын

Пікірлер: 18
@roywastaken
@roywastaken Жыл бұрын
your solutions are lowkey better than Neetcode's and that's crazy
@crackfaang
@crackfaang Жыл бұрын
I’d rather have his subscriber count though 😂
@Rutik9999
@Rutik9999 Ай бұрын
@@crackfaang lol 🤣
@sarayarmohammadi3376
@sarayarmohammadi3376 Жыл бұрын
Please keep posting videos. I really like your solutions better than NeetCode most of the times.
@janarboke4005
@janarboke4005 7 ай бұрын
I like how you went through what the hashmap will look like in the beginning, very clear
@noextrasugar
@noextrasugar 5 ай бұрын
I don't understand how this channel doesn't have 500k+ subscribers??!
@TAEWANKIM88
@TAEWANKIM88 Жыл бұрын
I like this version of using BFS. Thanks!
@zungulutrungu6407
@zungulutrungu6407 2 жыл бұрын
hey king could you please do 1129. Shortest Path with Alternating Colors ? thanks and keep uploading!!
@crackfaang
@crackfaang 2 жыл бұрын
Sure, let me add it to my work queue
@H4WKGAMING
@H4WKGAMING 2 жыл бұрын
great explanation!
@crackfaang
@crackfaang 2 жыл бұрын
Thanks for your support and make sure to subscribe so you don’t miss future videos!
@H4WKGAMING
@H4WKGAMING 2 жыл бұрын
@@crackfaang can you please do Product of Array Except Self?
@l501l501l
@l501l501l 2 жыл бұрын
Very intuitive compared to DFS version in most of the videos.
@yingxie9974
@yingxie9974 Ай бұрын
very good !
@user-vt8dd6fj7v
@user-vt8dd6fj7v 2 жыл бұрын
Am super confused on line 19
@derilraju2106
@derilraju2106 2 жыл бұрын
You are just pushing each neighbor into the neighbors list of the parent node
@subee128
@subee128 Жыл бұрын
Thanks
@derilraju2106
@derilraju2106 2 жыл бұрын
If someone is looking for equivalent DFS solution: from collections import deque class Solution: def cloneGraph(self, node: 'Node') -> 'Node': if not node: return None cloned = {} cloned[node] = Node(node.val,[]) # DFS solution def dfs(node): if not node: return None for neigh in node.neighbors: if not neigh in cloned: cloned[neigh] = Node(neigh.val,[]) dfs(neigh) cloned[node].neighbors.append(cloned[neigh]) dfs(node) return cloned[node]
Clone Graph - Leetcode 133 - Graphs (Python)
13:38
Greg Hogg
Рет қаралды 5 М.
Clone Graph - Depth First Search - Leetcode 133
11:48
NeetCode
Рет қаралды 242 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
NEXT PERMUTATION | LEETCODE # 31 | PYTHON OPTIMAL SOLUTION
18:50
Cracking FAANG
Рет қаралды 15 М.
Amazon Coding Interview Question - Clone Graph (LeetCode)
13:56
AlgosWithMichael
Рет қаралды 34 М.
WORD SEARCH | LEETCODE 79 | PYTHON DFS SOLUTION
18:54
Cracking FAANG
Рет қаралды 4,1 М.
GROUP SHIFTED STRINGS | LEETCODE 249 | PYTHON SOLUTION
15:07
Cracking FAANG
Рет қаралды 4,4 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 577 М.
ACCOUNTS MERGE | LEETCODE # 721 | PYTHON SOLUTION
23:04
Cracking FAANG
Рет қаралды 13 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 241 М.
Ful Video ☝🏻☝🏻☝🏻
1:01
Arkeolog
Рет қаралды 14 МЛН