Cache key normalization
Your task
An edge cache turns each request URL into a cache key. A URL is a path, then optionally a question mark and a query string of name=value pairs joined by ampersands. Names are unique within a URL, values may be empty, and no path, name or value contains an ampersand, a question mark or an equals sign. Two requests share a cache entry when their paths match exactly and, after discarding every parameter whose name appears in ignored_params, the remaining name=value pairs match as a set, so the order the parameters were written in is irrelevant. Given the requests in arrival order and the list of parameter names to discard, return a list where position i holds the index of the earliest request that shares request i's cache entry. A request that opens a new entry reports its own index.
Examples
cache_entry_owner(urls: list[str], ignored_params: list[str]) -> list[int]cache_entry_owner(["/img/logo.png?w=200&fmt=webp", "/img/logo.png?fmt=webp&w=200", "/img/logo.png?w=400&fmt=webp"], [])[0, 0, 2]cache_entry_owner(["/a?sid=1&v=2", "/a?v=2&sid=9", "/a?v=2"], ["sid"])[0, 0, 0]cache_entry_owner(["/home", "/home?", "/help"], [])[0, 0, 2]