Available question text
Given a rooted tree where each node's value equals its index, answer queries asking for the maximum XOR between a given value and any node value on the path from a specified node to the root; efficiently solved by doing a DFS and maintaining a dynamic binary trie (insert/remove node indices as you traverse) to support fast max-XOR lookups.
Related questions
Continue with questions that share topics or the same question type.
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 1938. Maximum Genetic Difference Query
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source