← Microsoft questions

Delete nodes with path sum < k

Filed under Microsoft

Given a binary tree and an integer k, delete all nodes that do not lie on any path from root to leaf with a total sum greater than or equal to k. A node should be kept if it belongs to at least one…

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

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