摘要:
题目 代码class Solution {public: bool isAnagram(string s, string t) { //字符交换了位置,但是每个字符的个数是一样的 map res1,res2; if(s.size... 阅读全文
posted @ 2018-09-14 08:13
李正浩
阅读(77)
评论(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
李正浩
阅读(93)
评论(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
李正浩
阅读(88)
评论(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
李正浩
阅读(93)
评论(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
李正浩
阅读(119)
评论(0)
推荐(0)

浙公网安备 33010602011771号