diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/determine_strings_close.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/determine_strings_close.cpp')
-rw-r--r-- | other/determine_strings_close.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/other/determine_strings_close.cpp b/other/determine_strings_close.cpp deleted file mode 100644 index 89e2322..0000000 --- a/other/determine_strings_close.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - bool closeStrings(string word1, string word2) { - if (word1.size() != word2.size()) - return false; - vector<int> c1(26), c2(26); - for (auto i = 0; i < word1.size(); ++i) { - ++c1[word1[i] - 'a']; - ++c2[word2[i] - 'a']; - } - if (!equal(begin(c1), end(c1), begin(c2), end(c2), - [](int a, int b) { return (bool)a == bool(b); })) - return false; - sort(begin(c1), end(c1)); - sort(begin(c2), end(c2)); - return c1 == c2; - } -}; - -int main() { - Solution obj; - if (obj.closeStrings("abc", "bca")) - cout << "true"; - else - cout << "false"; -} |