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/num_matching_subsequence.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 other/num_matching_subsequence.cpp (limited to 'other/num_matching_subsequence.cpp') diff --git a/other/num_matching_subsequence.cpp b/other/num_matching_subsequence.cpp deleted file mode 100644 index a97d464..0000000 --- a/other/num_matching_subsequence.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int numMatchingSubseq(string s, vector &words) { - int ans = 0; - unordered_map up; - for (int i = 0; i < words.size(); i++) - up[words[i]]++; - for (auto it = up.begin(); it != up.end(); it++) - if (helper(s, it->first)) - ans += it->second; - return ans; - } - -private: - int helper(string a, string b) { - int i = 0, j = 0, m = a.size(), n = b.size(); - while (i < m && j < n) { - if (a[i] == b[j]) - i++, j++; - else - i++; - } - return (j == n); - } -}; - -int main() { - Solution obj; - string s = "abcde"; - vector words = {"a", "bb", "acd", "ace"}; - cout << obj.numMatchingSubseq(s, words); -} -- cgit v1.2.3