XOR Operation in Array

Easy
Math Math Bit Manipulation

Given n and start, return start XOR (start+2) XOR (start+4) XOR ... XOR (start+2*(n-1)).

Constraints

1 ≤ n ≤ 1000

Examples

Example 1:
Input: 5 0
Output: 8
Example 2:
Input: 4 3
Output: 8
▲ Console
📱

Install Talent Enrich

Get instant access to jobs and career tools on your device.