You are given a list of strings.
A subset of strings is considered valid if, after concatenating all selected strings, every character appears at most once.
Your goal is to return any valid subset that maximizes the total number of distinct characters covered.
If multiple subsets achieve the same maximum coverage, returning any one of them is acceptable.
In plain English, the overall goal is to choose a subset of strings so that no character is repeated across the chosen strings, while covering as many distinct characters as possible.
The project already includes helper logic used by the test suite to validate a candidate subset and measure how many distinct characters it covers. However, that logic is currently incorrect — most of this part's tests fail against it.
Your task is to update the existing implementation so that it correctly:
- rejects invalid subsets,
- accepts valid subsets, and
- computes the correct number of covered distinct characters.
Keep the public behavior and interfaces unchanged.
test_accepts_legal_but_suboptimal_selection
test_accepts_single_word
test_accepts_single_character_words
test_accepts_all_words_when_disjoint
test_rejects_internal_duplicate_word_accepts_clean_word
test_rejects_global_character_overlap_accepts_disjoint_words
test_rejects_words_not_in_input_accepts_listed_words
test_empty_selection_is_valid