Search
⌘K
Get Premium
Leetcode 629. K Inverse Pairs Array
Count how many permutations of 1..n have exactly k inverse pairs (inversions). This is a combinatorics/DP counting problem (answer mod 1e9+7) with n,k up to 1000, requiring efficient recurrence or prefix-sum optimization to compute counts.
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.