Your question is Map Dictionary Manipulation. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Antino Labs mobile configuration is stored as a nested Python dictionary. Implement apply_updates(config, updates) to apply ordered set and delete operations using dot-separated paths.
A set operation must create missing intermediate dictionaries. If an intermediate value is not a dictionary, replace it with an empty dictionary before continuing. A delete operation should do nothing when its path or an intermediate dictionary does not exist. After deletion, remove empty parent dictionaries created by that deletion. The function must not mutate the input config.
config is a dictionary containing JSON-compatible values.updates is a list of dictionaries. Each update has op, which is either "set" or "delete", and path, a non-empty dot-separated string.set update also contains value, which may be any JSON-compatible value.def apply_updates(config, updates):