Decode XORed Array LeetCode solution in JavaScript

1
var decode = function (encoded, first) {
2
return [first].concat(encoded).map((x, i, a) => {
3
return i === 0 ? x : (a[i] ^= a[i - 1]);
4
});
5
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0