We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4bd1ce commit 70c46a2Copy full SHA for 70c46a2
javascript/0988-smallest-string-starting-from-leaf.js
@@ -23,24 +23,24 @@ var smallestFromLeaf = function(root) {
23
24
const char = String.fromCharCode(node.val+97);
25
26
- if(!node.left && !node.right) {
+ if (!node.left && !node.right) {
27
str.push(char);
28
const str1 = str.slice(0).reverse().join("");
29
- if(str1 < smallest) {
+ if (str1 < smallest) {
30
smallest = str1;
31
}
32
str.pop();
33
return;
34
35
36
37
- if(node.left) {
+ if (node.left) {
38
39
dfs(node.left, str);
40
41
42
43
- if(node.right) {
+ if (node.right) {
44
45
dfs(node.right, str);
46
0 commit comments