We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b418dc commit 002f09eCopy full SHA for 002f09e
README.md
@@ -21,12 +21,12 @@ Mistakes
21
22
23
Approach #2 BFS
24
-1. Take a clone node and map, node which are cloned keep adding into the map
+1. Take a clone node and array of 101 len (check constrain), node which are cloned keep adding into the array on Val index
25
2. Add visited node into the queue, run unit queue is empty
26
1. pop for queue
27
2. for each neighbor
28
- 1. if neighbor is map, add it neighbor of pop node
29
- 2. else clone it, add into the map, add as a neighbor pf pop node
+ 1. if neighbor is not in array, add it neighbor into array, adding into queue
+ 2. (no else, for all) get the cloned neighbor from array and adding to cloned curr node (find in array by currNode.Val)
30
31
32
0 commit comments