We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc06595 commit 2e79fceCopy full SHA for 2e79fce
count-vowel-strings-in-ranges/index.kt
@@ -2,19 +2,14 @@ package com.github.masx200.leetcode_test.count_vowel_strings_in_ranges
2
3
class Solution {
4
fun vowelStrings(words: Array<String>, queries: Array<IntArray>): IntArray {
5
-
6
7
val prefixs = IntArray(words.size) { 0 }
8
9
words.forEachIndexed { i, s ->
10
if (i == 0) {
11
12
prefixs[i] = booleanToInt(isVowelString(s))
13
} else {
14
prefixs[i] = prefixs[i - 1] + booleanToInt(isVowelString(s))
15
16
}
17
18
19
return IntArray(queries.size) {
20
val li = queries[it][0]
0 commit comments