Given a non-negative integer n, form every distinct permutation of its decimal digits (leading zeros are allowed, so the arrangement is read as an ordinary number) and return the XOR of all those numbers. Permutations that produce the same digit arrangement are counted only once.
Input: A JSON object {"n": <non-negative integer>}.
Output: Return the XOR of every distinct digit permutation of n.
Input: {"n":12}
Output: 25
Explanation: Arrangements 12 and 21 give 12 XOR 21 = 25.Input: {"n":11}
Output: 11
Explanation: Both arrangements are 11, so only one distinct value remains -> 11.0 <= n < 10^8 (at most 8 digits)