Return list of top n keys by value from a dictionary.
Implement this function:
def top_n_keys(d: dict, n: int) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: d, n.
Input
{'a': 5, 'b': 9, 'c': 1, 'd': 7}
2
Output
['b', 'd']