Search⌘ K
AI Features

Solution: Number of People Aware of a Secret

Understand how to apply dynamic programming to solve the Number of People Aware of a Secret problem. Learn to track daily sharers using a dp array, optimize calculations with modular arithmetic, and compute the final count before people forget the secret.

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 ...