Tap here to switch tabs
Problem
Submissions

Problem: Divide Array in Sets of K Consecutive Numbers

med
30 min
Try to solve the Divide Array in Sets of K Consecutive Numbers problem.

Statement

Given an integer array nums and an integer k, determine whether it is possible to divide the array into sets where each set contains exactly k consecutive integers.

Return true if nums can be partitioned into such sets, and false otherwise.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Divide Array in Sets of K Consecutive Numbers

med
30 min
Try to solve the Divide Array in Sets of K Consecutive Numbers problem.

Statement

Given an integer array nums and an integer k, determine whether it is possible to divide the array into sets where each set contains exactly k consecutive integers.

Return true if nums can be partitioned into such sets, and false otherwise.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤109\leq 10^9