How would you approach a string parsing coding problem?
Implement parse_pairs(text) for a comma-separated string of key=value pairs. Return a dictionary with whitespace removed around keys and values. If a key appears more than once, keep its last value. Inputs contain valid nonempty keys and values.
Contract: text is a string, and the function returns a dictionary. An empty string returns {}.
Examples: "name=Alex, role=Engineer" returns {"name": "Alex", "role": "Engineer"}. "mode=dev, mode=prod" returns {"mode": "prod"}.
def parse_pairs(text):