You are given a dictionary records keyed by record id (string). Each value is a record whose fields include a numeric key named by the string field. You are also given that field name.
Return a list of all record ids, ordered by the value of records[id][field] in descending order. When two records have the same value for that field, order those ids in ascending order among themselves.
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
{'p1': {'score': 10, 'age': 30}, 'p2': {'score': 20, 'age': 25}, 'p3': {'score': 10, 'age': 40}}
'score'
Returns
['p2', 'p1', 'p3']