1486. XOR Operation in an Array

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1486

class Solution:
    def xorOperation(self, n: int, start: int) -> int:
        return reduce(xor, ((start + 2 * i) for i in range(n)))