Company: Kickdrum_13oct
Difficulty: medium
People Aware of Feature Problem Description A new in-app feature launches on day 1 and one early adopter learns about it. A user who learns the feature on day d starts telling others from day (d + delay) and forgets (stops knowing and stops sharing) from day (d + forgetAfter) . Each day, every user who is currently in their "sharing window" tells exactly one new user (who learns that day). Given the number of days n , return how many users still know the feature on day n . Since the number can be large, return it modulo 1,000,000,007. Input Format: Integer n - total days to simulate Integer delay - days after learning when a user starts sharing Integer forgetAfter - days after learning when a user forgets Output Format: Single integer - users who still know the feature on day n (mod 1e9+7) Examples Example 1: Input: n=6, delay=2, forgetAfter=4 Output: 5 Explanation: Day 1: Suppose the first person is named A. (1 person) Day 2: A is the only person who knows the secret. (1 person) Day 3