摘要: 参考:https://www.cnblogs.com/grandyang/p/4781203.html class Solution { public: int hIndex(vector<int>& citations) { sort(citations.begin(),citations.end 阅读全文
posted @ 2020-03-26 11:36 qiujiejie 阅读(97) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: bool isAnagram(string s, string t) { vector<int> ms(26,0),mt(26,0); for(auto& str:s) ++ms[str-'a']; for(auto& str:t) ++mt[str 阅读全文
posted @ 2020-03-26 10:46 qiujiejie 阅读(91) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int countPrimes(int n) { if(!n) return 0; vector<bool> isPrime(n,true); isPrime[0]=false;isPrime[1]=false; for(int i=2;i*i<n; 阅读全文
posted @ 2020-03-26 10:40 qiujiejie 阅读(118) 评论(0) 推荐(0) 编辑