Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1397. Find All Good Strings
Count the number of length-n lowercase strings lexicographically between s1 and s2 (inclusive) that do not contain the substring evil, returning the result mod 1e9+7. Solve with a DP over positions that tracks lexicographic tightness and the current matched prefix of evil (using a KMP/automaton) to avoid forbidden substrings.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.