Write a function. Test real cases. Improve your solution.
tests is a list of {"id": string, "features": [strings]} objects with unique ids. Choose the fewest tests whose combined features cover every name in required_features. Return their ids as an ascending list. If multiple minimum-size choices work, return the lexicographically smallest sorted id list using Python's normal string ordering. Extra covered features are allowed, and duplicate feature names count once. Return [] when no features are required and None when coverage is impossible. There are at most 12 tests, so checking combinations is acceptable. Do not mutate either input.
[[{"id": "smoke", "features": ["login", "search"]}, {"id": "login-only", "features": ["login"]}, {"id": "search-only", "features": ["search"]}], ["login", "search"]]["smoke"]
[[{"id": "A", "features": ["1", "2", "3", "4"]}, {"id": "B", "features": ["1", "2", "5"]}, {"id": "C", "features": ["3", "4", "6"]}], ["1", "2", "3", "4", "5", "6"]]["B", "C"]
[[{"id": "D", "features": ["y"]}, {"id": "C", "features": ["x"]}, {"id": "B", "features": ["y"]}, {"id": "A", "features": ["x"]}], ["x", "y"]]["A", "B"]
[[{"id": "A", "features": ["x"]}], ["x", "missing"]]None
[[{"id": "A", "features": ["x"]}], []][]
[[{"id": "B", "features": ["x", "x", "extra"]}, {"id": "A", "features": ["x"]}], ["x", "x"]]["A"]
[[], ["x"]]
None
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.