Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You can simnplify your code by using list comprehension for creating 'phrase_list' and 'new_indexes'. You could also use enumerate(indexes) to loop through the indexes and insert the word at a specified location.
I'm not sure it's the only problem with your code, but it returns False if both arrays are empty (the description requires to return False if they are
None
, but not if they are empty).