class Solution {
public:
vector<int> findNumsAppearOnce(vector<int>& nums) {
int s = 0;
for (int x: nums) {
s ^= x;
}
int k = 0;
while (!(s >>k & 1)) {
++k;
}
int t = 0;
for (int x: nums) {
if (x >> k & 1) {
t ^= x;
}
}
return {t, s ^ t};
}
};