Find anagram

Write codeEasy12 min

Your task

Given a list of lowercase words and a lowercase target word, return the first word in the list that is an anagram of the target but not identical to it. Return an empty string if there is none. For example, with words ['stale', 'hello', 'least'] and target 'steal', the answer is 'stale'.

Examples

anagram_partner(words: list[str], target: str) -> str
Example 1
Inputanagram_partner(["stale", "hello", "least"], "steal")
Output"stale"