Skip to content

Commit bf25eb0

Browse files
update 199
1 parent 76b1570 commit bf25eb0

File tree

1 file changed

+1
-0
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+1
-0
lines changed

src/main/java/com/fishercoder/solutions/_199.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void rightView(TreeNode curr, List<Integer> result, int currDepth) {
2626
if (currDepth == result.size()) {
2727
result.add(curr.val);
2828
}
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
2930
rightView(curr.right, result, currDepth + 1);
3031
rightView(curr.left, result, currDepth + 1);
3132
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy