1
# Runtime: 304 ms (Top 61.38%) | Memory: 15.7 MB (Top 75.38%)3
#####################################################################################################################4
# Problem: Hand of Straights5
# Solution : Hash Table, Min Heap6
# Time Complexity : O(n logn)7
# Space Complexity : O(n)8
#####################################################################################################################12
def isNStraightHand(self, hand: List[int], groupSize: int) -> bool:13
if len(hand) % groupSize:16
freq = collections.defaultdict(int)21
min_heap = list(freq.keys())22
heapq.heapify(min_heap)25
smallest = min_heap[0]26
for num in range(smallest, smallest + groupSize):32
if num != min_heap[0]:34
heapq.heappop(min_heap)