You are viewing a single comment's thread. Return to all comments →
Kotlin Solution
fun matchingStrings(strings: Array<String>, queries: Array<String>): Array<Int> { val counts = strings.groupingBy { it }.eachCount() return queries.map {query -> counts[query] ?: 0 }.toTypedArray() }
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Kotlin Solution