
stl
xutian_curry
这个作者很懒,什么都没留下…
展开
-
两个数组的交集
考察点:map的常见使用#include <set> #include <vector> #include <map> using namespace std; class Solution { public: vector<int> intersect(vector<int>& nums1, vector<int&...原创 2018-04-22 17:03:02 · 159 阅读 · 0 评论 -
有效的字母异位词
#include <unordered_map> #include <string> using namespace std; class Solution { public: bool isAnagram(string s, string t) { unordered_map<char,int> mymap; ...原创 2018-04-22 17:23:57 · 431 阅读 · 0 评论 -
单词模式
#include <unordered_map> #include <iostream> #include <string> using namespace std; class Solution { public: bool wordPattern(string pattern, string str) { istrin...原创 2018-04-22 18:09:27 · 459 阅读 · 0 评论 -
leetcode 同构字符串
#include <unordered_map> using namespace std; class Solution { public: bool isIsomorphic(string s, string t) { unordered_map<char,char> mymap; for(int i=0;i<s.size...原创 2018-04-23 15:00:54 · 371 阅读 · 0 评论