← Samsung questions

Remove nodes outside a given range in BST

Filed under Samsung

Given the root of a Binary Search Tree (BST) and two integers min and max, trim the tree such that all its nodes have values in the range [min, max].

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 Samsung questions

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