← 返回 google 的题目列表Group Array
类型:online_judge
Given an array of N two-digit numbers. A group of numbers can be chosen from the array only if all of them share at least one common digit. For example, numbers 52, 25, and 55 can be chosen together (they share digit 5), but 11, 52, and 34 cannot. Compute the maximum number of array elements that can be chosen together.
Input:
An integer array consisting of N two-digit numbers.
Output:
An integer representing the maximum number of elements that can be chosen together.
Example
Input
[52, 25, 55, 11, 34]