Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Consistent Strings

med
30 min
Try to solve the Count the Number of Consistent Strings problem.

Statement

You are given a string allowed consisting of distinct characters and an array of strings words. A string is considered consistent if every character in it appears in the string allowed.

Return the total number of consistent strings in the array words.

Constraints:

  • 1≤1 \leq words.length ≤104\leq 10^4

  • 1≤1 \leq allowed.length ≤26\leq 26

  • 1≤1 \leq words[i].length ≤10\leq 10

  • The characters in allowed are distinct.

  • words[i] and allowed contain only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count the Number of Consistent Strings

med
30 min
Try to solve the Count the Number of Consistent Strings problem.

Statement

You are given a string allowed consisting of distinct characters and an array of strings words. A string is considered consistent if every character in it appears in the string allowed.

Return the total number of consistent strings in the array words.

Constraints:

  • 1≤1 \leq words.length ≤104\leq 10^4

  • 1≤1 \leq allowed.length ≤26\leq 26

  • 1≤1 \leq words[i].length ≤10\leq 10

  • The characters in allowed are distinct.

  • words[i] and allowed contain only lowercase English letters.