https://leetcode.com/problems/count-the-number-of-consistent-strings/description/ Easy

Решение

class Solution {
    fun countConsistentStrings(allowed: String, words: Array<String>): Int {
        val ok = BooleanArray(26)
        for (c in allowed) {
            ok[c - 'a'] = true
        }
        var result = 0
        outer@ for (word in words) {
            for (c in word) {
                if (!ok[c - 'a']) continue@outer
            }
            result++
        }
        return result
    }
}