Tap here to switch tabs
Problem
Submissions

Problem: Divide Array in Sets of K Consecutive Numbers

Divide Array in Sets of K Consecutive Numbers asks whether an integer array can be partitioned into groups of exactly k values, with each group forming consecutive integers. Return true or false.

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

Divide Array in Sets of K Consecutive Numbers asks whether an integer array can be partitioned into groups of exactly k values, with each group forming consecutive integers. Return true or false.

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