Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2327. Number of People Aware of a Secret
Count how many people know a secret after n days when each person starts sharing every day beginning delay days after learning it and stops (forgets) after forget days. This reduces to a DP/sliding-window problem where new sharers on a day equal the sum of people who learned the secret between (day - forget + 1) and (day - delay), with the result modulo 1e9+7.
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.