diff --git a/cpp/more/0383.cpp b/cpp/more/0383.cpp new file mode 100644 index 0000000..f234f0d --- /dev/null +++ b/cpp/more/0383.cpp @@ -0,0 +1,12 @@ +#include +#include + +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; + } +};