← 返回 google 的题目列表Maximum Two-Digit Number Group Selection
类型:online_judge
Given several two-digit numbers, e.g., 11, 21, 31, 41, 16, 17, 18, 34, 57. Determine the maximum number of numbers you can take at once such that they have at least one digit in common.
Input
A list of two-digit integers.
Output
An integer representing the maximum number of numbers that can be taken.
Example
Input: [11, 21, 31, 41, 16, 17, 18, 34, 57] Output: 7
Explanation
The list [11, 21, 31, 41, 16, 17, 18] all contain the digit 1.
Constraints
List length does not exceed 1000, and all numbers are two digits.
Example
Input
10
11 22 33 44 55 66 77 88 99 10