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 for some cases.
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_valid_selection_scores_distinct_characters
test_rejects_internal_duplicate_word
test_rejects_global_character_overlap
test_rejects_words_not_in_input
test_empty_selection_is_valid