Practice Count the Number of Computer Unlocking Permutations
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Count the Number of Computer Unlocking Permutations
Problem Statement
Computer 0 is the initially unlocked root. To unlock computer i, a previously unlocked computer j must satisfy both j < i and complexity[j] < complexity[i]. Count the valid permutations of all computer labels representing the unlocking order, beginning with root 0, and return the count modulo 10^9 + 7. The initially unlocked password belongs specifically to label 0, not an arbitrary first computer.
Source: Count the Number of Computer Unlocking Permutations on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
complexity = [1,2,3]
2
# Example 2
complexity = [3,3,3,4,4,4]
0
Constraints
Related LeetCode Problems
Practice more problems similar to Count the Number of Computer Unlocking Permutations.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.