You are given an integer array complexity of length n, where complexity[i] represents the security complexity of computer i. There are n computers numbered from n
Initially, you have access to the root password to unlock computer j can be unlocked if and only if there is at least one already unlocked computer i such that complexity[i] < complexity[j].
An unlocking sequence is a permutation p of all computer indices from n
p[0]
For every index k from n i with i complexity[p[i]] < complexity[p[k]]
Return the number of valid unlocking permutations. Since the answer may be large, return it modulo
Constraints:
complexity.length
complexity[i]
You are given an integer array complexity of length n, where complexity[i] represents the security complexity of computer i. There are n computers numbered from n
Initially, you have access to the root password to unlock computer j can be unlocked if and only if there is at least one already unlocked computer i such that complexity[i] < complexity[j].
An unlocking sequence is a permutation p of all computer indices from n
p[0]
For every index k from n i with i complexity[p[i]] < complexity[p[k]]
Return the number of valid unlocking permutations. Since the answer may be large, return it modulo
Constraints:
complexity.length
complexity[i]