Find largest subset sharing a common digit
Company: Google
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Take-home Project
Quick Answer: 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.
Constraints
- Numbers are two-digit integers in normal inputs
Examples
Input: ([11, 21, 31, 41, 16, 17, 18, 34, 57],)
Expected Output: 7
Input: ([23, 35, 30, 19],)
Expected Output: 3
Input: ([10, 22, 33],)
Expected Output: 1
Input: ([],)
Expected Output: 0
Hints
- Count how many numbers contain each digit, counting a number once per digit even if repeated.