Skip to content

Commit 35eb828

Browse files
refactor 629
1 parent a44cfd2 commit 35eb828

File tree

1 file changed

+0
-23
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-23
lines changed

src/main/java/com/fishercoder/solutions/_629.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 629. K Inverse Pairs Array
5-
*
6-
* Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs.
7-
We define an inverse pair as following: For ith and jth element in the array,
8-
if i < j and a[i] > a[j] then it's an inverse pair; Otherwise, it's not.
9-
Since the answer may very large, the answer should be modulo 109 + 7.
10-
11-
Example 1:
12-
Input: n = 3, k = 0
13-
Output: 1
14-
Explanation:
15-
Only the array [1,2,3] which consists of numbers from 1 to 3 has exactly 0 inverse pair.
16-
17-
Example 2:
18-
Input: n = 3, k = 1
19-
Output: 2
20-
Explanation:
21-
The array [1,3,2] and [2,1,3] have exactly 1 inverse pair.
22-
23-
Note:
24-
The integer n is in the range [1, 1000] and k is in the range [0, 1000].
25-
*/
263
public class _629 {
274

285
public static class Solution1 {

0 commit comments

Comments
 (0)