auto commit
This commit is contained in:
@ -276,7 +276,7 @@ Output: [1, 3, 2]
|
||||
Explanation: The [1, 3, 2] has three different positive integers ranging from 1 to 3, and the [2, 1] has exactly 2 distinct integers: 1 and 2.
|
||||
```
|
||||
|
||||
题目描述:数组元素为 1\~n 的整数,要求构建数组,使得相邻元素的差值不相同的个数为 k。
|
||||
题目描述:数组元素为 1~n 的整数,要求构建数组,使得相邻元素的差值不相同的个数为 k。
|
||||
|
||||
让前 k+1 个元素构建出 k 个不相同的差值,序列为:1 k+1 2 k 3 k-1 ... k/2 k/2+1.
|
||||
|
||||
|
Reference in New Issue
Block a user