Company: Oracle_23sep
Difficulty: medium
Infection Sequences Problem Description A town has n houses in a straight line, numbered from 1 to n from left to right. A virus starts in m houses that are already infected, given in the array infectedHouses . The infection spreads in days. If house X is infected by the end of day i , then on day i + 1 its neighbours X - 1 and X + 1 (those that exist and are not yet infected) become infected. All houses that become infected on the same day are infected together, so the infection day of every house is fixed. Eventually every house is infected. An infection sequence lists every house that was not initially infected, in the order in which the houses get infected. A house infected on an earlier day always appears before a house infected on a later day, while the houses infected on the same day may appear in any order among themselves. Two sequences are distinct if they differ in at least one position. Implement the function getInfectionSequencesCount(n, infectedHouses) , which returns the