[LeetCode] 1456. Maximum Number of Vowels in a Substring of Given Length
·
코딩테스트/Python
🔗 Problem Linkhttps://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length/description/❔Thinking문자열 s와 정수 k가 주어질 때, k개의 문자를 가지는 s의 부분 문자열 가운데에서 모음(a,e,i,o,u)이 최대 몇 개인지 반환한다.s = 'abciiidef', k = 3 인 경우 output은 3이다. (부분 문자열 'iii')s = 'aeiou', k = 2 인 경우 output은 2이다 (어떤 부분 문자열이라도 2) 💻Solution1. two-pointer를 활용한 풀이def maxVowels(self, s: str, k: int) -> int: left = 0 ..