Loka interview question

To sort a json object by their keys, returning nested dictionaries.