Optimal Permutation with XOR Condition

Company: Infosys SP

Difficulty: medium