(user_id, signup_month, active_months) where active_months is a set of month numbers. Write retention_by_cohort(users) returning a dict mapping each signup month to the percentage (1-decimal) of that cohort active in signup_month + 1.retention_by_cohort([(1, 0, {0, 1}), (2, 0, {0}), (3, 1, {1, 2})]){0: 50.0, 1: 100.0}Cohort 0: one of two returned in month 1. Cohort 1: its single user returned.
Two dicts: cohort sizes and retained counts.
Round at the end per cohort.