Playlist contains requirements

Write codeEasy10 min

Your task

Before publishing a themed playlist, an editor checks it against a requirements list of must-include song ids. The playlist satisfies the requirements when every id in the requirements list appears somewhere in the playlist; repeats in either list are irrelevant, and an empty requirements list is trivially satisfied. Given the playlist and the requirements (both lists of song id strings), return true if the playlist contains every required song and false otherwise. For example, playlist ["a", "b", "c"] satisfies requirements ["c", "a"] but not ["a", "d"].

Examples

contains_all(playlist: list[str], required: list[str]) -> bool
Example 1
Inputcontains_all(["a", "b", "c"], ["c", "a"])
OutputTrue
Example 2
Inputcontains_all(["a", "b"], ["a", "d"])
OutputFalse