Given an array of integers hand where hand[i] is the value of the i-th card, and an integer groupSize, return true if and only if the hand can be rearranged into groups of groupSize consecutive cards.
Example 1:
Input: hand = [1,2,3,6,2,3,4,7,8], groupSize = 3
Output: true
Explanation: The hand can be rearranged as [1,2,3], [2,3,4], [6,7,8].
Example 2:
Input: hand = [1,2,3,4,5], groupSize = 4
Output: false
Explanation: The hand cannot be rearranged into groups of 4 consecutive cards.
Example 3:
Input: hand = [1,2,3,4,5,6], groupSize = 2
Output: true
Explanation: The hand can be rearranged as [1,2], [3,4], [5,6].
1 <= hand.length <= 10^40 <= hand[i] <= 10^91 <= groupSize <= hand.length