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
PostgreSQLv16

Her vises resultatet af din kode

Visible tests
1
Input
5, 0
Expected8
2
Input
4, 3
Expected8
3
Input
1, 7
Expected7
4
Input
10, 5
Expected2
5
Input
2, 2
Expected6
6
Input
1, 2
Expected2
Focus radio
Paused · SomaFM · Fluid