XOR Number Row
Here you first build a simple number sequence, then reduce it using the bitwise XOR operation. Given n and start, create a list of length n where the element at index i is start + 2*i. Return the XOR of all elements in that list.
Примеры
Ввод
5, 0Вывод
8Ввод
4, 3Вывод
8Ввод
1, 7Вывод
7Нужно реализовать
def xor_operation(n: int, start: int) -> int:
Теги
matharray
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inVisible tests
1
Input
5, 0Expected
82
Input
4, 3Expected
83
Input
1, 7Expected
74
Input
10, 5Expected
25
Input
2, 2Expected
66
Input
1, 2Expected
2Focus radio
Paused · SomaFM · Fluid