You are given an integer array hand, where each value represents a card rank, and an integer groupSize. Determine whether it is possible to reorder hand so that it can be partitioned into groups of exactly groupSize cards, where each group consists of groupSize consecutive ranks.
Return true if such a partitioning is possible, otherwise return false.
Note: This problem is the same as LeetCode
.
Constraints:
hand.length
hand[i]
groupSize hand.length
You are given an integer array hand, where each value represents a card rank, and an integer groupSize. Determine whether it is possible to reorder hand so that it can be partitioned into groups of exactly groupSize cards, where each group consists of groupSize consecutive ranks.
Return true if such a partitioning is possible, otherwise return false.
Note: This problem is the same as LeetCode
.
Constraints:
hand.length
hand[i]
groupSize hand.length