Prime String
Problem Overview
- Count how many ways a digit string can be split into prime numbers, keeping order and using all characters.
- Input: string s (length 1–1e5, no leading zero). Segments must be primes in [2, 10^6] with no leading zeros. Output: count modulo 1,000,000,007.
- Domain: string parsing and number theory; large-count handling typical in a coding interview problem.
- This Snowflake interviews interview question assesses edge cases, constraints, and correctness under limits.
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:
