Search
⌘K

Leetcode 3395. Subsequences with a Unique Middle Mode I

Count the number of length-5 subsequences whose middle element is the unique mode (i.e., appears strictly more times than any other value in the five), returning the result modulo 1e9+7. The core challenge is combinatorial counting for each index as the middle—using prefix/suffix frequencies to count ways to pick two left and two right elements so the middle value’s frequency strictly exceeds all others.


Question Timeline

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

Comments

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