R, 49 bytes,
Not the shortest answer, but eh !
Here, we :
- take as input the sequence as a character string
- split it into its digits
strsplit(x, ""), creating a list (an R object),
- flatten the list
unlist(x), creating a vector (another R object).
The items in the vector are converted to integers
strtoi, on which the XOR logical operation is applied
bitwXor, with respect to
Here we're taking advantage of R's recycling. Both elements of the fonction
bitwXor are vectors, but have different length. The function reuse the shortest vector to apply the operation to each element of the longest vector.
Briefly, XOR (⊕) table of truth is :
1 ⊕ 1 = 0
1 ⊕ 0 = 1
0 ⊕ 1 = 1
0 ⊕ 0 = 0