Tap here to switch tabs
Problem
Submissions

Problem: Compare Strings by Frequency of the Smallest Character

med
30 min
Try to solve the Compare Strings by Frequency of the Smallest Character problem.

Statement

Let the function f(s)f(s) return the frequency of the lexicographically smallest character in a non empty string ss.

Given two string arrays queries and words, return an integer array answer where answer[i] represents the count of words w in words such that f(ext‘queries[i]‘)<f(w)f( ext{`queries[i]`}) < f(w).

Constraints:

  • 1≤1 \leq queries.length ≤2000\leq 2000

  • 1≤1 \leq words.length ≤2000\leq 2000

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

  • queries[i][j] and words[i][j] consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Compare Strings by Frequency of the Smallest Character

med
30 min
Try to solve the Compare Strings by Frequency of the Smallest Character problem.

Statement

Let the function f(s)f(s) return the frequency of the lexicographically smallest character in a non empty string ss.

Given two string arrays queries and words, return an integer array answer where answer[i] represents the count of words w in words such that f(ext‘queries[i]‘)<f(w)f( ext{`queries[i]`}) < f(w).

Constraints:

  • 1≤1 \leq queries.length ≤2000\leq 2000

  • 1≤1 \leq words.length ≤2000\leq 2000

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

  • queries[i][j] and words[i][j] consist of lowercase English letters.