← Swiggy questions
CodingReported in a candidate post, Jan 2021

Print the top view of a binary tree

Filed under Swiggy

Given the root of a binary tree, return the values of the nodes that are visible when the tree is viewed from above, ordered from left to right. If two nodes share the same horizontal position, only…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Swiggy questions

Collected from public candidate posts and coding forums. Updated Nov 2026.