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/max_num_vowel_substr.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 other/max_num_vowel_substr.cpp (limited to 'other/max_num_vowel_substr.cpp') diff --git a/other/max_num_vowel_substr.cpp b/other/max_num_vowel_substr.cpp deleted file mode 100644 index fe24499..0000000 --- a/other/max_num_vowel_substr.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// 1456. Maximum Number of Vowels in a Substring of Given Length -#include "leetcode.h" - -/* - * given a string 's' and an integer 'k', return the maximum - * number of vowel letters in any substring of 's' with length - * 'k'. vowel letters in english are 'a e i o u' - */ - -class Solution { -public: - int maxVowels(string s, int k) { - int count = 0, counting = 0; - unordered_set bag = {'a', 'e', 'i', 'o', 'u'}; - for (int i = 0, local = 0; i < s.size(); i++) { - local += bag.count(s[i]); - if (i - k >= 0) - local -= bag.count(s[i - k]); - count = max(count, local); - } - return count; - } -}; - -int main() { - Solution obj; - cout << obj.maxVowels("abciiidef", 3); // expect: 3 - cout << obj.maxVowels("aeiou", 2); // expect: 2 - cout << obj.maxVowels("leetcode", 3); // expect: 2 -} -- cgit v1.2.3