This question evaluates the ability to analyze arrays for the largest subset sharing a common digit, emphasizing digit-level feature extraction, frequency analysis, and set-based reasoning. Commonly asked in the Coding & Algorithms domain, it assesses practical algorithmic implementation and efficient aggregation/counting with basic data structures rather than purely conceptual reasoning.
You are given a list A of two-digit integers (each from 10 to 99). Two integers are said to “share a digit” if they have at least one digit in common (e.g., 23 and 35 share digit 3).
Determine the maximum size of a subset of A such that all numbers in the subset share at least one common digit (i.e., there exists a digit d in {0,1,...,9} that appears in every number in the chosen subset).
Input: Array/list A of length m, with each A[i] in [10, 99].
Output: An integer = the maximum possible subset size.
Example:
A = [23, 35, 30, 19]
3
appears in
23, 35, 30
→ answer is
3
.