摘要: Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.思考:map应用。遍历两次strs,第一次建立map,第二次打印符合提议的字符串。class Solution {private: vector res; map m;public: vector anagrams(vector &strs) { int i; for(i=0;i::iterator iter=m.find(t... 阅读全文
posted @ 2014-01-11 14:31 七年之后 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文
posted @ 2014-01-11 13:57 七年之后 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2014-01-11 12:30 七年之后 阅读(144) 评论(0) 推荐(0) 编辑