1311. Find XOR of Digits of a Number

EasyBit ManipulationBit ManipulationXORDigits

Given a non-negative integer n, return the XOR of its decimal digits.

Input: A JSON object {"n": <non-negative integer>}.

Output: Return the XOR of all decimal digits of n.

Examples

Example 1
Input: {"n":1234}
Output: 4
Explanation: 1^2^3^4 = 4.
Example 2
Input: {"n":77}
Output: 0
Explanation: 7^7 = 0.

Constraints

Asked by

TCSInfosysWiproCognizantCapgemini
Solve this problem in the editor →