Sponsored
Use these hints if you're stuck. Try solving on your own first.
Since that encoded[i] = arr[i] XOR arr[i+1], then arr[i+1] = encoded[i] XOR arr[i].
Iterate on i from beginning to end, and set arr[i+1] = encoded[i] XOR arr[i].
Solve with full IDE support and test cases