Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbea7a4d

Browse files
refactor 1296
1 parenta89097f commitbea7a4d

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

‎src/main/java/com/fishercoder/solutions/_1296.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,6 @@
22

33
importjava.util.TreeMap;
44

5-
/**
6-
* 1296. Divide Array in Sets of K Consecutive Numbers
7-
*
8-
* Given an array of integers nums and a positive integer k,
9-
* find whether it's possible to divide this array into sets of k consecutive numbers
10-
* Return True if its possible otherwise return False.
11-
*
12-
* Example 1:
13-
* Input: nums = [1,2,3,3,4,4,5,6], k = 4
14-
* Output: true
15-
* Explanation: Array can be divided into [1,2,3,4] and [3,4,5,6].
16-
*
17-
* Example 2:
18-
* Input: nums = [3,2,1,2,3,4,3,4,5,9,10,11], k = 3
19-
* Output: true
20-
* Explanation: Array can be divided into [1,2,3] , [2,3,4] , [3,4,5] and [9,10,11].
21-
*
22-
* Example 3:
23-
* Input: nums = [3,3,2,2,1,1], k = 3
24-
* Output: true
25-
*
26-
* Example 4:
27-
* Input: nums = [1,2,3,4], k = 3
28-
* Output: false
29-
* Explanation: Each array should be divided in subarrays of size 3.
30-
*
31-
* Constraints:
32-
* 1 <= nums.length <= 10^5
33-
* 1 <= nums[i] <= 10^9
34-
* 1 <= k <= nums.length
35-
* */
365
publicclass_1296 {
376
publicstaticclassSolution1 {
387
publicbooleanisPossibleDivide(int[]nums,intk) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp