Company: Atlassian_31july
Difficulty: medium
Infection Sequences Count Problem Description In a town with n houses aligned in a straight line, numbered from 1 to n from left to right. A virus is spreading from an initially infected house. Every day an infected house spreads the virus to its immediate uninfected neighbors. Specifically, if house number X is infected on day i , then houses X-1 and X+1 will become infected on day i+1 if they are not already infected. Eventually, all houses will become infected. The sequence in which the houses get infected is called the infection sequence. Given integer n and an integer array infectedHouses representing the initial infected houses, determine the total number of distinct infection sequences possible, modulo (10 9 + 7). Examples Example 1: Input: n = 5, infectedHouses = [1, 5] Output: 2 Explanation: Initially, houses 1 and 5 are infected. The infection progresses as follows: On Day 1, both houses numbers 2 and 4 become infected. On Day 2, house number 3 is infected. Now all the houses