Company: Tech Mahindra
Difficulty: medium
Cancellation Notification Problem Description Mia had planned a get-together at her place, but an urgent work commitment forced her to call it off. She had originally invited N neighbors, all living in houses arranged along a single straight street next to her own. Some of those neighbors are the helpful, chatty type, while others keep to themselves. Whenever a chatty neighbor hears about the cancellation, whether straight from Mia or passed along by another chatty neighbor, that person can pass the news on to at most four others: the two houses immediately to the left and the two immediately to the right. A quiet, uncooperative neighbor, on the other hand, will hear the news and never pass it further. Because she is pressed for time, Mia can only place a single phone call, to a single neighbor, to start the news spreading. She still wants to reach as many neighbors as possible with that one call. To keep track, she plans to mark every neighbor as "I" once they've heard the news, and "