Imagine a circular ring of 19 cells. Each cell has a coronavirus inside it: either active or inactive. Scientists have developed a special drug that can target a specific cell (of your choice). When the drug hits its target, it affects not only the targeted cell but also its 2 neighbors! The effect of the drug on these three cells is unusual: if the coronavirus in that cell was active, it become inactive; if the coronavirus in that cell wsa inactive, it become active! In other words, one dose of a drug toggles the state of 3 coronaviruses in 3 adjacent cells. If all coronaviruses are active in the initial state, is there a sequence of drug targets so that all coronaviruses become inactive at the same time? What is the length of the smallest such sequence?
This puzzle is from https://gurmeet.net/puzzles/nineteen-coronaviruses/index.html
SPOILER ALERT: The solution is present here at this link.
My approach: I realised if N was a multiple of 3, then best would be to hit every 3rd element. But another observation was that I thought of probably smaller N first eg 4,5,6,..3k+1 particularly and realised N would be the answer here. But I am looking for a more sophisticated approach. The first part is discoverable, that the sequence is permutation invariant. So, we remove duplicates as well. Till this, it is fine. But next step comes off a bit weird to me. How did they come up with this? Why isn't something like 011 allowed? Is it because it follows a linear sequence rather than circular so since this results in left 0 being active so we don't allow this?