arrow_back Back to Challenges

#199 Binary Tree Right Side View

Medium Acceptance 0%
description

Problem Description

Given the `root` of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.

checklist Constraints

The number of nodes in the tree is in the range [0, 100].
-100 <= Node.val <= 100

science Examples

Case #1

In: root = [1,2,3,null,5,null,4]
Out: [1,3,4]

Case #2

In: root = [1,null,3]
Out: [1,3]

Mastery Tags

Graphs Trees

Hiring Companies

Amazon Bloomberg Meta
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude