People Aware of Feature

Company: Kickdrum_17sep

Difficulty: medium

Problem Statement

People Aware of Feature Problem Description A product team releases a new in-app feature. On day 1 , exactly one user discovers it. From then on, word of the feature spreads from user to user, following these rules: A user who discovers the feature on day d starts recommending it on day d + delay . The same user forgets about the feature on day d + forgetAfter . From that day on they no longer know about it and no longer recommend it. On every day that a user is recommending the feature (days d + delay through d + forgetAfter - 1 ), that user introduces it to exactly one user who has never heard of it. The new user discovers the feature on that same day. The pool of users who have never heard of the feature is unlimited. Complete the function peopleAwareOfFeature with the following parameters: n : the number of days to simulate (day 1 through day n ) delay : how many days after discovering the feature a user starts recommending it forgetAfter : how many days after discovering the featu