当前位置:网站首页>Numbers that appear only once
Numbers that appear only once
2022-07-07 07:49:00 【Free dreamer】
This question examines the nature of XOR
Knowledge point : The same number is XOR 0, Because the other elements of this problem appear twice, you can pair XOR until there is only one XOR that appears only once
class Solution {
public:
int singleNumber(vector<int>& nums) {
for(int i=1;i<nums.size();i++){
nums[0]^=nums[i];
}
return nums[0];
}
};
边栏推荐
- Wechat applet data binding multiple data
- Installing postgresql11 database under centos7
- Build personal website based on flask
- Pytest+allure+jenkins installation problem: pytest: error: unrecognized arguments: --alluredir
- Leanote private cloud note building
- JSON introduction and JS parsing JSON
- 242. Bipartite graph determination
- Robot technology innovation and practice old version outline
- Info | webrtc M97 update
- [guess-ctf2019] fake compressed packets
猜你喜欢
【webrtc】m98 screen和window采集
What are the positions of communication equipment manufacturers?
[webrtc] M98 screen and window acquisition
JSON introduction and JS parsing JSON
IO流 file
leetcode:105. 从前序与中序遍历序列构造二叉树
misc ez_ usb
Asemi rectifier bridge rs210 parameters, rs210 specifications, rs210 package
BGP experiment (1)
[Stanford Jiwang cs144 project] lab3: tcpsender
随机推荐
buuctf misc USB
vus. Precautions for SSR requesting data in asyndata function
IO流 file
Explore Cassandra's decentralized distributed architecture
[P2P] local packet capturing
pytest+allure+jenkins环境--填坑完毕
php导出百万数据
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
Mutual conversion between InputStream, int, shot, long and byte arrays
即刻报名|飞桨黑客马拉松第三期等你挑战
pytest+allure+jenkins安装问题:pytest: error: unrecognized arguments: --alluredir
Rust Versus Go(哪种是我的首选语言?)
3、 High quality programming and performance tuning practical youth training camp notes
Solve could not find or load the QT platform plugin "xcb" in "
[webrtc] m98 Screen and Window Collection
Leanote private cloud note building
C语言航班订票系统
Gslx680 touch screen driver source code analysis (gslx680. C)
About some details of final, I have something to say - learn about final CSDN creation clock out from the memory model
科技云报道:从Robot到Cobot,人机共融正在开创一个时代