Aristocrat game-content tools may need to normalize a text instruction and explore possible symbol arrangements. Implement one function that reverses the words in a sentence and generates every distinct permutation of a separate string.
Given sentence and token, return a dictionary with:
reversed_sentence: the words from sentence in reverse order, joined by a single space. Any leading, trailing, or repeated whitespace is ignored.permutations: every distinct arrangement of the characters in token, returned in lexicographic order.The sentence contains non-empty words separated by arbitrary whitespace. The token contains lowercase English letters and may contain repeated characters.
def reverse_words_and_permutations(sentence, token):