Filter sales log
Your task
A sales log stores one sale per row as "product,region,amount", where amount is an integer. Return the rows (unchanged, in their original order) where the region equals region AND the amount is at least min_amount. Example: rows ["mug,west,30", "tee,east,50", "cap,west,80"] with region "west" and min_amount 40 give ["cap,west,80"].
Examples
filter_sales(rows: list[str], region: str, min_amount: int) -> list[str]Example 1
Input
filter_sales(["mug,west,30", "tee,east,50", "cap,west,80"], "west", 40)Output
["cap,west,80"]