class Solution {
public:
vector<int> decode(vector<int>& encoded, int first) {
vector<int> ans;
ans.push_back(first);
for (int i = 0; i < encoded.size(); i++)
{
ans.push_back(ans[i] ^ encoded[i]);
}
return ans;
}
};
LeetCode 解码异或后的数组
最新推荐文章于 2021-05-06 16:07:29 发布