解码异或后的数组
Posted 秦枫-_-
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解码异或后的数组相关的知识,希望对你有一定的参考价值。
class Solution {
public int[] decode(int[] encoded, int first) {
int []res=new int[encoded.length+1];
res[0]=first;
for(int i=1;i<res.length;i++){
res[i]=encoded[i-1]^first;
first=res[i];
}
return res;
}
}
以上是关于解码异或后的数组的主要内容,如果未能解决你的问题,请参考以下文章