← Amazon questions

Count Root-to-Leaf Paths with Less Than K Bad Nodes

Filed under Amazon

Given an n-ary tree where nodes contain values 0 (bad node) or 1 (good node), count the number of root-to-leaf paths that contain fewer than K bad nodes.

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

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