add: 0383

This commit is contained in:
Eatswap 2022-10-31 00:58:46 +08:00
parent 09ed316e00
commit bb83b31326
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
1 changed files with 12 additions and 0 deletions

12
cpp/more/0383.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <string>
#include <algorithm>
class Solution {
public:
bool canConstruct(const std::string& r, const std::string& m) {
for (char c = 'a'; c <= 'z'; ++c)
if (std::count(r.begin(), r.end(), c) > std::count(m.begin(), m.end(), c))
return false;
return true;
}
};