Solved LeetCode program · 944 of 1,000
#1310 · XOR Queries of a Subarray
Original English source
The numbers is a list of 1, 3, 4, and 8. The lefts is a list of 0, 1, 0, and 3. The rights is a list of 1, 2, 3, and 3. The prefixes is a list of 5 zeros.
For every spot from 0 to 3.
The mixed is exclusive or of item spot of prefixes and item spot of numbers. Set item (spot plus 1) of prefixes to mixed.
The pieces is an empty list of text.
For every query from 0 to 3.
The left is item query of lefts. The right is item query of rights. The value is exclusive or of item (right plus 1) of prefixes and item left of prefixes. The piece is format whole number value as text. Place piece into pieces.
The line is join pieces with ",". Show line.
Expected stdout
2,7,14,8