Loading

摘要: 题目 代码class Solution {public: bool isValidSudoku(vector>& board) { //判断9宫格 for(int i=1;i table; table[ boar... 阅读全文
posted @ 2018-09-13 15:37 李正浩 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: vector twoSum(vector& nums, int target) { vector res; std::map table; for(int i=0;i插入... 阅读全文
posted @ 2018-09-13 15:35 李正浩 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: void moveZeroes(vector& nums) { int numOfZero=0; for(int i=0;i=0) nums[i-numOfZer... 阅读全文
posted @ 2018-09-13 15:32 李正浩 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: vector plusOne(vector& digits) { int plusFlag=0; int isEnd=1; for(auto i=digits.rbegi... 阅读全文
posted @ 2018-09-13 15:29 李正浩 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 题目代码class Solution {public: vector intersect(vector& nums1, vector& nums2) { std::map table1,table2; vector result; ... 阅读全文
posted @ 2018-09-13 15:26 李正浩 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 题目代码class Solution {public: int singleNumber(vector& nums) { int temp=0; for(auto i:nums) { temp^=i; ... 阅读全文
posted @ 2018-09-13 11:01 李正浩 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: bool containsDuplicate(vector& nums) { std::map dic; for(auto i:nums) { di... 阅读全文
posted @ 2018-09-13 10:57 李正浩 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: void rotate(vector& nums, int k) { if(nums.size()==0||nums.size()==1) return; if(... 阅读全文
posted @ 2018-09-13 10:55 李正浩 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int maxProfit(vector& prices) { //总的利润 int maxSalary=0; if(prices.size()==0) ... 阅读全文
posted @ 2018-09-13 10:52 李正浩 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 题目代码class Solution {public: int removeDuplicates(vector& nums) { if(nums.size()<=1) return nums.size(); int re... 阅读全文
posted @ 2018-09-13 10:46 李正浩 阅读(81) 评论(0) 推荐(0) 编辑