Skip to content

Commit 87d0d8e

Browse files
authored
Added Spacing
1 parent 0582fd2 commit 87d0d8e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

javascript/0872-leaf-similar-trees.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
var leafSimilar = function(root1, root2) {
1818

1919
const dfs = (node, arr) => {
20-
if(!node.left && !node.right) {
20+
if (!node.left && !node.right) {
2121
arr.push(node.val);
2222
return arr;
2323
}
24-
if(node.left) dfs(node.left, arr);
25-
if(node.right) dfs(node.right, arr);
24+
if (node.left) dfs(node.left, arr);
25+
if (node.right) dfs(node.right, arr);
2626

2727
return arr;
2828
}
2929

3030
const arr1 = dfs(root1, []);
3131
const arr2 = dfs(root2, []);
3232

33-
if(arr1.length !== arr2.length) return false;
33+
if (arr1.length !== arr2.length) return false;
3434

35-
for(let i = 0; i < arr1.length; i++) {
36-
if(arr1[i] !== arr2[i]) return false;
35+
for (let i = 0; i < arr1.length; i++) {
36+
if (arr1[i] !== arr2[i]) return false;
3737
}
3838

3939
return true;

0 commit comments

Comments
 (0)