Keep only feedback themes backed by enough quotes
Your task
Every quarter, someone spends a week turning user feedback from support, app reviews, sales notes and the forum into themes. An agent clusters the feedback now, and only themes with enough evidence reach the roadmap discussion.
Write select_supported_themes(theme_names, quote_counts, distinct_sources, min_quotes): the check each week's themes pass through.
theme_names(list of str): the themes the agent found.quote_counts(list of int): how many verbatim quotes back each theme.distinct_sources(list of int): how many different channels those quotes come from.min_quotes(int): the fewest quotes a theme needs this week.- Index
iin each list is one theme. Return the names of the supported themes, in rank order.
Rules:
- Drop a theme with 0 or fewer quotes, whatever
min_quotesis. - Drop a theme with fewer quotes than
min_quotes. - Drop a theme whose quotes come from fewer than 2 channels.
- Return the rest by quote count, highest first. Equal counts go in ascending name order. A name that appears twice is listed twice.
Examples
select_supported_themes(theme_names: list[str], quote_counts: list[int], distinct_sources: list[int], min_quotes: int) -> list[str]Example 1
Input
select_supported_themes(["slow sync", "confusing pricing", "crash on upload"], [12, 5, 3], [3, 2, 1], 4)Output
["slow sync", "confusing pricing"]Example 2
Input
select_supported_themes(["export bug"], [9], [1], 3)Output
[]Example 3
Input
select_supported_themes([], [], [], 2)Output
[]