From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/add_search_words_data.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 other/add_search_words_data.cpp (limited to 'other/add_search_words_data.cpp') diff --git a/other/add_search_words_data.cpp b/other/add_search_words_data.cpp deleted file mode 100644 index 5c5e0f4..0000000 --- a/other/add_search_words_data.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "leetcode.h" - -class WordDictionary { -public: - WordDictionary() {} - void addWord(string word) { words[word.size()].push_back(word); } - bool search(string word) { - for (auto s : words[word.size()]) - if (isEqual(s, word)) - return true; - return false; - } - -private: - unordered_map> words; - bool isEqual(string a, string b) { - for (int i = 0; i < a.size(); i++) { - if (b[i] == '.') - continue; - if (a[i] != b[i]) - return false; - } - return true; - } -}; - -int main() { - WordDictionary *obj = new WordDictionary(); - obj->addWord("WordDictionary"); - bool param_2 = obj->search("WordDictionary"); - if (param_2) - cout << "found"; - else - cout << "not found"; -} -- cgit v1.2.3