摘要:
参考:https://www.cnblogs.com/grandyang/p/4781203.html class Solution { public: int hIndex(vector<int>& citations) { sort(citations.begin(),citations.end 阅读全文
摘要:
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 阅读全文
摘要:
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; 阅读全文