Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 940. Distinct Subsequences II
Count the number of distinct non-empty subsequences of a string modulo 1e9+7. This is typically solved with dynamic programming that doubles the count for each new character but corrects for duplicates by subtracting contributions from the character's previous occurrence (n ≤ 2000, lowercase letters).
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.