DIY: Divide Array in Sets of K Consecutive Numbers

Problem statement

In this challenge, you are given an array of integers nums and a positive integer k. You have to determine whether it is possible to divide the elements of the array into groups of k consecutive numbers.

Input

The inputs will be an array of integers called nums and a positive integer k. ...

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Devpath's Terms of Service and Privacy Policy