← 返回 google 的题目列表Maximize Group Size with Shared Digits
类型:online_judge
Given an array containing two-digit numbers, with a maximum length of 100, group the numbers that share at least one digit (e.g., 55, 58, 25, 45 can be grouped together as they share the digit 5. Numbers like 55, 66, and 77 cannot be grouped together if they share no digit). Calculate the maximum possible group size.
Example
Input
[55, 56, 57, 58, 59]