Follow redirect chains
Your task
A link checker resolves the redirect table a documentation site ships before it publishes a release. Each entry of rules is written as a source path, a greater-than sign, then a target path, for example /old>/new, and every path begins with a slash. When two entries name the same source, the first entry wins. For each path in starts, follow the redirects, since a path with no rule is where a chain ends. Return one verdict per start in the same order. The verdict is the word loop when the walk arrives at a path it already visited, counting the start itself. It is the word limit when the walk is still standing on a path that has a rule after max_hops hops, so a chain that runs out of hops reports limit even when a loop lies further ahead. Otherwise the verdict is the final path.
Examples
redirect_chain_outcomes(rules: list[str], starts: list[str], max_hops: int) -> list[str]redirect_chain_outcomes(["/intro>/getting-started", "/getting-started>/guides/start", "/old-faq>/faq"], ["/intro", "/faq", "/old-faq"], 5)["/guides/start", "/faq", "/faq"]redirect_chain_outcomes(["/a>/b", "/b>/c", "/c>/a"], ["/a", "/b", "/d"], 10)["loop", "loop", "/d"]redirect_chain_outcomes(["/1>/2", "/2>/3"], ["/1"], 1)["limit"]