简单运用了哈希表求字符数量的作用
class Solution {
public:
bool canConstruct(string a, string b) {
unordered_map<char,int>hash;
for(auto c:b)hash[c]++;
for(auto c:a){
if(!hash[c])return false;
else hash[c]--;
}
return true;
}
};