your solutions are lowkey better than Neetcode's and that's crazy
@crackfaang Жыл бұрын
I’d rather have his subscriber count though 😂
@janarboke40055 ай бұрын
I like how you went through what the hashmap will look like in the beginning, very clear
@sarayarmohammadi337610 ай бұрын
Please keep posting videos. I really like your solutions better than NeetCode most of the times.
@noextrasugar3 ай бұрын
I don't understand how this channel doesn't have 500k+ subscribers??!
@TAEWANKIM88 Жыл бұрын
I like this version of using BFS. Thanks!
@l501l501l Жыл бұрын
Very intuitive compared to DFS version in most of the videos.
@zungulutrungu64072 жыл бұрын
hey king could you please do 1129. Shortest Path with Alternating Colors ? thanks and keep uploading!!
@crackfaang2 жыл бұрын
Sure, let me add it to my work queue
@H4WKGAMING2 жыл бұрын
great explanation!
@crackfaang2 жыл бұрын
Thanks for your support and make sure to subscribe so you don’t miss future videos!
@H4WKGAMING2 жыл бұрын
@@crackfaang can you please do Product of Array Except Self?
@subee12810 ай бұрын
Thanks
@user-vt8dd6fj7v2 жыл бұрын
Am super confused on line 19
@derilraju2106 Жыл бұрын
You are just pushing each neighbor into the neighbors list of the parent node
@derilraju2106 Жыл бұрын
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]