Algorithm · Oracle · Medium
You receive n cards, each labeled with a distinct integer, along with a positive integer groupSize. Determine whether all cards can be separated into groups so that: every group contains exactly groupSize cards; the labels in each group, when sorted, form a block of consecutive increasing integers. The input has two lines. The first line contains two integers n and groupSize. The second line contains n space-separated integers, the labels of hand. Print true if a valid…
Checking your access…