aboutsummaryrefslogtreecommitdiff
path: root/unique_morse_code_words.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-03-10 00:36:13 -0600
committerJack Sangdahl <[email protected]>2025-03-10 00:36:13 -0600
commit7c60dee83b436e8e8a667bf9f191beced8de4fc3 (patch)
treeeb7a24ee2067f92245c57bb118e85a1baf15df50 /unique_morse_code_words.cpp
parent5d7cdc215e4ba1ec4cbb24c084cccb5e5e641468 (diff)
downloadleetcode-7c60dee83b436e8e8a667bf9f191beced8de4fc3.tar.gz
leetcode-7c60dee83b436e8e8a667bf9f191beced8de4fc3.zip
chore: move cpp and rust code to directory
Diffstat (limited to 'unique_morse_code_words.cpp')
-rw-r--r--unique_morse_code_words.cpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/unique_morse_code_words.cpp b/unique_morse_code_words.cpp
deleted file mode 100644
index 2a6280e..0000000
--- a/unique_morse_code_words.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int uniqueMorseRepresentations(vector<string> &words) {
- vector<string> codes = {
- ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",
- ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.",
- "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."};
- set<string> ans;
- for (auto word : words) {
- string curr = "";
- for (auto ch : word)
- curr += codes[ch - 97];
- ans.insert(curr);
- }
- return ans.size();
- }
-};
-
-int main() {
- Solution obj;
- vector<string> words = {"gin", "zen", "gig", "msg"};
- cout << obj.uniqueMorseRepresentations(words);
-}