Leetcode 645 Set Mismatch
来源:互联网 发布:c语言栈实现四则运算 编辑:程序博客网 时间:2024/06/02 03:10
Leetcode 645 Set Mismatch
#include <vector>#include <algorithm>using namespace std;class Solution {public: vector<int> findErrorNums(vector<int>& nums) { int size = nums.size(); vector<int> result; vector<int> copyVec(size,0); for(int i = 0;i < size;i ++) { if(copyVec[nums[i]- 1] == 0) { copyVec[nums[i]-1] = nums[i]; } else result.push_back(nums[i]); } vector<int>::iterator iter = find(copyVec.begin(),copyVec.end(),0); if(iter != copyVec.end()) result.push_back(iter - copyVec.begin() + 1); return result; }};
阅读全文
0 0
- LeetCode 645 Set Mismatch
- Leetcode 645 Set Mismatch
- leetcode--645--Set Mismatch
- LeetCode 645 : Set Mismatch(java)
- leetcode 645. Set Mismatch
- [LeetCode]645. Set Mismatch
- 【LeetCode】645. Set Mismatch
- LeetCode 645. Set Mismatch
- leetcode 645. Set Mismatch
- [LeetCode]645. Set Mismatch
- leetcode 645. Set Mismatch
- Leetcode 645. Set Mismatch 找缺值 解题报告
- leetcode[Set Mismatch]//待整理多种解法
- 2017.12.25 LeetCode 645. Set Mismatch 【思维查找】
- 645. Set Mismatch
- 645. Set Mismatch
- leetcode645. Set Mismatch
- 645. Set Mismatch
- bzoj3527: [Zjoi2014]力
- Leetcode 633 Sum of Square Numbers
- 2D赛车
- jsp中$、EL表达式不起作用的问题
- 2017 ACM/ICPC Asia Regional Shenyang Online【solved:7 / 12】
- Leetcode 645 Set Mismatch
- vitamio诡异bug?
- 编译GPU版本Matconvnet
- leetcode448. Find All Numbers Disappeared in an Array
- 小米手机 Installation failed with message Failed to establish session
- c#利用IronPython调用python的过程种种问题
- nginx 解决跨域和cookie问题
- 常用linux iptables 25个规则
- Android动画之Property Animation(属性动画)