We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76b1570 commit bf25eb0Copy full SHA for bf25eb0
src/main/java/com/fishercoder/solutions/_199.java
@@ -26,6 +26,7 @@ void rightView(TreeNode curr, List<Integer> result, int currDepth) {
26
if (currDepth == result.size()) {
27
result.add(curr.val);
28
}
29
+ //go through right side first as we want right side view, so as soon as we find it, then we won't use the one from left side
30
rightView(curr.right, result, currDepth + 1);
31
rightView(curr.left, result, currDepth + 1);
32
0 commit comments