一个普通程序员.
© 2022. All rights reserved.
Easy
签到题,直接根据题目意思生成数组,遍历异或求解,AC!
python3
class Solution: def xorOperation(self, n: int, start: int) -> int: r = 0 a = [start + x*2 for x in range(n)] for i in a: r = r ^ i return r