Available question text
Count the permutations of [0..n-1] such that for each requirement (end_i, cnt_i) the prefix perm[0..end_i] has exactly cnt_i inversions, returning the result modulo 1e9+7. The core challenge is a combinatorics/DP counting problem: impose exact inversion counts on specified prefixes (n ≤ 300) and efficiently enumerate valid inversion sequences or prefix constructions.
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 3193. Count the Number of Inversions
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source