Write a function. Test real cases. Improve your solution.
Combine a list of configuration dictionaries from left to right, with later layers taking precedence. When an existing value and an incoming value are both dictionaries, merge them recursively. In every other case, replace the old value completely with the incoming value, including lists, False, zero, and None. A list is replaced, not concatenated. None is an explicit value, not a deletion marker. Return {} for no layers. All data is JSON-compatible, and nested dictionaries have string keys. Do not mutate any layer. Grading checks values and input integrity, not object identity.
[[{"server": {"host": "localhost", "port": 8000}}, {"server": {"port": 9000}, "debug": True}]]{"server": {"host": "localhost", "port": 9000}, "debug": True}[[{"plugins": ["base", "legacy"]}, {"plugins": ["new"]}]]{"plugins": ["new"]}[[{"cache": False, "log": {"level": "info"}}, {"cache": {"enabled": True}, "log": "off"}]]{"cache": {"enabled": True}, "log": "off"}[[{"token": "old", "enabled": True, "retries": 3}, {"token": None, "enabled": False, "retries": 0}]]{"token": None, "enabled": False, "retries": 0}[[]]
{}[[{"api": {"timeouts": {"connect": 2, "read": 10}}}, {"api": {"timeouts": {"read": 20}}}, {"api": {"timeouts": {"write": 5}}}]]{"api": {"timeouts": {"connect": 2, "read": 20, "write": 5}}}[[{"settings": {"mode": "safe"}}, {"settings": {}}]]{"settings": {"mode": "safe"}}Python 3.14 runs in your browser. The first run downloads about 13 MB; your browser can cache it for later visits. Each run starts fresh. Use synchronous functions and core standard-library modules. Network requests, package installs, and interactive input() are unavailable. Return lists, string-key dictionaries, strings, finite numbers, bools, or None. Student code stops after about four seconds, after Python loads. Python engine credits. Test results support self-study and don’t certify proficiency.