Hand of Straights

Medium · Greedy · about 20 minutes

Asked at Google, Amazon, Microsoft, Meta.

Alice has cards with values hand. She wants to rearrange them into groups of size groupSize, where each group is groupSize consecutive values. Return true if she can.