We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdc4a4c commit ae78c6eCopy full SHA for ae78c6e
validate-binary-tree-nodes/index.ts
@@ -21,17 +21,17 @@ export default function validateBinaryTreeNodes(
21
)
22
return false;
23
24
- const visted = new Set<number>();
+ const visited = new Set<number>();
25
26
const q = [degree.findIndex((a) => a === 0)];
27
for (const i of q) {
28
- if (visted.has(i)) continue;
+ if (visited.has(i)) continue;
29
30
- visted.add(i);
+ visited.add(i);
31
[leftChild[i], rightChild[i]]
32
.filter((a) => a >= 0)
33
.forEach((j) => q.push(j));
34
}
35
36
- return visted.size === n;
+ return visited.size === n;
37
0 commit comments