Assign 0/1 values to binary tree nodes so the subtree xor-sum costs total exactly K.
Unlock detailed company stats for this questionUpgrade
Given a binary tree with access to the root pointer, assign each node a value of 0 or 1. The cost of each subtree is the xor-sum of all nodes in that subtree. Make the total sum of the costs of all subtrees exactly K, where 0 <= K <= N.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
