You are given a dictionary transactions whose keys are transaction ids (strings) and whose values are records of the form {'category': str, 'amount': int | float}.
Return a dictionary that maps each category to the sum of the amount values of all transactions in that category. Only categories that actually appear in the input may be present in the result. The returned dictionary must be built in ascending order of category name. If transactions is empty, return an empty dictionary.
NOTE: This is a function-type question — you only write the function. Do not read input or print anything; a hidden checker calls your function and checks its return value.
Arguments
{'t1': {'category': 'food', 'amount': 10}, 't2': {'category': 'toys', 'amount': 5}, 't3': {'category': 'food', 'amount': 3}}
Returns
{'food': 13, 'toys': 5}