add: 0383
This commit is contained in:
parent
09ed316e00
commit
bb83b31326
|
|
@ -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;
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue