6846.Creating Strings II

Time Limit: 1s Memory Limit: 512MB

Given a string, your task is to calculate the number of different strings that can be created using its characters.

Input Format(From the terminal/stdin)

The only input line has a string of length $n$ . Each character is between a–z.

  • $1 \le n \le 10^6$

Output Format(To the terminal/stdout)

Print the number of different strings modulo $10^9+7$ .

Sample Input

Copy
aabac
     \n

Sample Output

Copy
20
  \n
Source: CSES, Mathematics, 1715

Submit

请先 登录

© 2025 FAQs