Search
⌘K

Leetcode 1866. Number of Ways to Rearrange Sticks With K Sticks Visible

Count how many permutations of 1..n have exactly k left-to-right visible sticks (records) — a combinatorics/DP counting problem where placing the largest stick either creates a new visible stick or not, yielding a simple recurrence solved modulo 1e9+7.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.