• World order broken?

Question related to mission Words Order

 

This code works well in Python interpreter 3.10 but not in the task.

def wordsorder(text: str, words: list) -> bool: textlist = str.split(" ") indexes = [] for x in words: if x in textlist: indexes.append(textlist.index(x)) else: return False return indexes == sorted(indexes)