Problem Statement

Given the root of a binary tree, return the nodes visible when the tree is viewed from the right side.

Only the last node at each level is visible.

Brute Force Intuition

In an interview, you can explain it like this: