Number of People Aware of a Secret
On the first day, one person discovers a secret.
You're provided with an integer, delay, indicating that each person will share the secret with a new person every day, starting delay days after discovering the secret. Additionally, you're given an integer, forget, indicating that each person will forget the secret forget days after discovering it. A person cannot share the secret on the same day they forgot it or on any subsequent day.
Given an integer, n, you need to determine and print the number of people who know the secret by the end of day n. Due to the potential size of the answer, print it modulo 10^9 + 7.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)