
Problem: 1720. 解码异或后的数组耗时100%异或运算是可以交换的 a ^ h c则 h a ^ c, 或者 a h ^ cCodeclass Solution { public: vectorint decode(vectorint encoded, int first) { int n encoded.size(); vectorint tr{first}; for(int i 0; i n; i) { tr.push_back(tr.back() ^ encoded[i]); } return tr; } };