Given an array of integers and a group size W, determine if the array can be divided into groups of W consecutive numbers.
Greedy: sort, use a Counter. For each smallest remaining number, try to form a group of W consecutive numbers.
💡 Pro tip: Understand this problem deeply — don't just memorize the code. Try explaining the approach out loud as if teaching a friend. If you can explain it simply, you truly understand it!
isNStraightHand([1,2,3,6,2,3,4,7,8], 3)
True
isNStraightHand([1,2,3,4,5], 4)
False