Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void checkMagazine(vector<string> magazine, vector<string> note) {
- string m;
- for(auto i:magazine)
- {
- m += i;
- }
- string n;
- for(auto i:note)
- {
- n += i;
- }
- map<char,int> mp;
- for(int i=0;i<m.size();i++)
- {
- mp[m[i]]++;
- }
- for(int i=0;i<n.size();i++)
- {
- if(mp[n[i]]!=0)
- {
- mp[n[i]]--;
- }
- else
- {
- cout<<"No";
- return;
- }
- }
- cout<<"Yes";
- return;
- }
Add Comment
Please, Sign In to add comment