Good Subsequences

Problem Overview

  • Count good subsequences of a lowercase word where all characters in the subsequence occur equally often; the empty subsequence is not allowed.
  • Input: a string of length 1–100000 over [a–z]. Output: number of good subsequences modulo 1,000,000,007.
  • Real-world domain: string processing and combinatorics; typical coding interview problem.
  • Company context: asked in Nutanix interviews and used as an interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: