Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2954. Count the Number of Infection Sequences
Count the number of distinct orders in which all uninfected people can become infected when infection spreads only to adjacent people from the initially sick positions; this is a combinatorics problem that partitions the line into segments between sick indices and counts interleavings of infections (multinomial) with extra multiplicative factors for middle segments due to bidirectional spread, modulo 1e9+7.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.