Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2147. Number of Ways to Divide a Long Corridor
Count the ways to insert dividers between characters in a string of 'S' (seats) and 'P' (plants) so every resulting section contains exactly two 'S', returning the result modulo 1e9+7. The core challenge is checking the total number of seats is even and then computing the combinatorial choices determined by the plant gaps between consecutive seat-pairs.
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.