[LeetCode] 2559. Count Vowel Strings in Ranges (Python)
·
알고리즘/LeetCode
난이도: Medium 문제 설명You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [l_i, r_i] asks us to find the number of strings present in the range li to ri (both inclusive) of words that start and end with a vowel. Return an array ans of size queries.length, where ans[i] is the answer to the ith query. Note that the vowel letters are 'a', 'e', 'i'..
[LeetCode] 1422. Maximum Score After Splitting a String (Python)
·
알고리즘/LeetCode
난이도: Easy 문제 설명Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring). The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring. 문제 예제Example 1:Input: s = "011101"Output: 5 Explanation: All possible ways of splitting s into..