1296. Divide Array in Sets of K Consecutive Numbers
https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers
Description
Given an array of integers nums
and a positive integer k
, find whether it is possible to divide this array into sets of k
consecutive numbers.
Return true
if it is possible.Otherwise, return false
.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= k <= nums.length <= 105
1 <= nums[i] <= 109
Note: This question is the same as 846: https://leetcode.com/problems/hand-of-straights/
ac
Previous1295. Find Numbers with Even Number of DigitsNext1297. Maximum Number of Occurrences of a Substring
Last updated