Tap here to switch tabs
Problem
Submissions

Problem: Compare Strings by Frequency of the Smallest Character

Compare Strings by Frequency of the Smallest Character asks you to count, for each query, how many words have a higher frequency for their lexicographically smallest character than the query does.

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(‘queries[i]‘)<f(w)f( {`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

Compare Strings by Frequency of the Smallest Character asks you to count, for each query, how many words have a higher frequency for their lexicographically smallest character than the query does.

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(‘queries[i]‘)<f(w)f( {`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.