Leetcode 3590. Kth Smallest Path XOR Sum
Compute each node's root-to-node XOR, and for each query return the k-th smallest distinct XOR value among all nodes in a given subtree (or -1 if there are fewer than k distinct values). The core challenge is answering subtree order-statistic queries over distinct static values, typically solved with Euler-tour + order-statistics structures, DSU-on-tree, or persistent/trie-based approaches.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.