Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Find the Kth Smallest Sum of a Matrix With Sorted Rows
Coding
- Kth Smallest Subarray Sum
Coding
- Binary Tree Maximum Path Sum
Coding · Binary Tree · Depth-First Search · DP on Trees
- Find Kth Largest XOR Coordinate Value
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3590. Kth Smallest Path XOR Sum
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source