Screen survey themes before a manager sees them
Your task
Your developer survey promised anonymity, and some free-text answers name names or describe situations only one person could have lived. An agent groups the answers into themes, and a screen decides what may reach a manager.
Write screen_survey_themes(theme_names, respondent_counts, has_identifiable_detail, k_floor): the screen every theme passes through.
theme_names(list of str): the theme names.respondent_counts(list of int): how many different people raised each theme.has_identifiable_detail(list of bool): the theme's quotes contain something that could identify a person.k_floor(int): the fewest respondents a theme needs before it can be shown. This is a k-anonymity floor: a theme from fewer people could point to one of them.- Return one verdict per theme, in order, written
"<name>:<verdict>".
Rules:
- Index
iin each list is one theme. Stop at the end of the shortest list. - A floor below 1 counts as 1.
- Trim the name. An empty name becomes
unnamed. - Fewer respondents than the floor:
"suppress". - Otherwise, identifiable detail:
"paraphrase". - Otherwise:
"release".
Examples
screen_survey_themes(theme_names: list[str], respondent_counts: list[int], has_identifiable_detail: list[bool], k_floor: int) -> list[str]Example 1
Input
screen_survey_themes(["flaky ci", "laptop specs", "review turnaround"], [12, 7, 3], [False, False, False], 5)Output
["flaky ci:release", "laptop specs:release", "review turnaround:suppress"]Example 2
Input
screen_survey_themes(["oncall load", "manager named in quote"], [9, 6], [False, True], 5)Output
["oncall load:release", "manager named in quote:paraphrase"]Example 3
Input
screen_survey_themes([], [], [], 5)Output
[]