Tata Consultancy Services (North America) receives ordered keyword lists from internal tooling. Given a list of words and a target word, reverse the list and identify every word in the reversed order that is an anagram of the target.
Two words are anagrams when they contain the same letters with the same frequencies. Matching must be case-insensitive, and every input word contains only alphabetic characters.
Implement reverse_and_find_anagrams(words, target).
words, a list of strings, and target, a string.reversed: the input words in reverse order.matches: the words from reversed that are anagrams of target, preserving their reversed order.Do not modify the original words list.
def reverse_and_find_anagrams(words, target):