Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2147. Number of Ways to Divide a Long Corridor
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source