Algorithm · Karat · Medium
You are given a string tiles in which each character is a digit representing one tile in a hand. Determine whether the hand is complete. A hand counts as complete when every tile can be assigned to exactly one group such that there is exactly one pair (two tiles showing the same digit) and all remaining groups are triples of three identical digits. Follow-ups Part 2: Extend the rule so that, in addition to triples of identical digits, a group of three may also be a run of…