You are given an integer n and a sick sorted in increasing order.
There are n individuals standing in a row, indexed from n sick contains the indices of the individuals who are initially infected. In each step, an uninfected individual can become infected if they are adjacent to at least one infected individual. The process continues until every individual is infected.
An infection sequence is the ordered list of indices of individuals as they become infected.
Return the total number of distinct possible infection sequences. Since the answer may be large, return it modulo
Constraints:
n
sick.length n
sick[i] n
sick is sorted in increasing order.
You are given an integer n and a sick sorted in increasing order.
There are n individuals standing in a row, indexed from n sick contains the indices of the individuals who are initially infected. In each step, an uninfected individual can become infected if they are adjacent to at least one infected individual. The process continues until every individual is infected.
An infection sequence is the ordered list of indices of individuals as they become infected.
Return the total number of distinct possible infection sequences. Since the answer may be large, return it modulo
Constraints:
n
sick.length n
sick[i] n
sick is sorted in increasing order.