Search⌘ K
AI Features

Solution: Number of People Aware of a Secret

Explore a dynamic programming approach to determine how many people are aware of a secret after n days. Understand how to track active sharers through delay and forget periods, and optimize the solution using modular arithmetic for large results.

Statement

On day 11, exactly one person discovers a secret.

Each person who learns the secret will begin sharing it with one new person every day, but only after a waiting period of delay days from when they first discovered it. Additionally, each person completely ...