Solution: Number of People Aware of a Secret
Understand how to apply dynamic programming to track the number of people aware of a secret over time, accounting for delay and forget periods. This lesson helps you implement an optimized O(n) solution by managing active sharers and modular arithmetic to efficiently solve complex sharing scenarios.
We'll cover the following...
We'll cover the following...
Statement
On day
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 ...