Loading

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页
摘要: 题目 代码class Solution {public: bool isAnagram(string s, string t) { //字符交换了位置,但是每个字符的个数是一样的 map res1,res2; if(s.size... 阅读全文
posted @ 2018-09-14 08:13 李正浩 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int firstUniqChar(string s) { std::map table; //先用map存储,value是出现的次数 for(int i=0;i<s.s... 阅读全文
posted @ 2018-09-14 08:11 李正浩 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int reverse(int x) { int rev = 0; while (x != 0) { int pop = x % 10; x ... 阅读全文
posted @ 2018-09-14 08:09 李正浩 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: string reverseString(string s) { for (int i=0,j=s.size()-1; i<=j; i++, j--) { std::swap(s[i],s[j]); }... 阅读全文
posted @ 2018-09-14 08:06 李正浩 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 题目代码class Solution {public: void rotate(vector>& matrix) { int n=matrix.size(); for(int i=0;i (0,3)(0,1) -> (1,3)(0,2) ->... 阅读全文
posted @ 2018-09-14 08:03 李正浩 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目 代码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) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 24 下一页