Available question text
Reconstruct the unique permutation perm of 1..n (n odd) given adjacent XORs encoded[i] = perm[i] ⊕ perm[i+1]; use XOR properties (overall XOR of 1..n and XOR of every other encoded entry) to recover the first element and then derive the rest sequentially.
Related questions
Continue with questions that share topics or the same question type.
- Decode XORed Array
Coding
- Build Array from Permutation
Coding
- Check Digitorial Permutation
Coding · Counting · Math
- Circular Permutation in Binary Representation
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 1734. Decode XORed Permutation
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source