Rearrange the Sentence

Published by Deep Xavier in

Given a sentence with numbers representing a word's location embedded within each word, return the sorted sentence.

Examples

rearrange("Tesh3 th5e 1I lov2e way6 she7 j4ust i8s.") ➞ "I love Tesh just the way she is."

rearrange("the4 t3o man5 Happ1iest of6 no7 birt2hday steel8!") ➞ "Happiest birthday to the man of no steel!"

rearrange("is2 Thi1s T4est 3a") ➞ "This is a Test"

rearrange("4of Fo1r pe6ople g3ood th5e the2") ➞ "For the good of the people"

rearrange(" ") ➞ ""

Notes

Only the integers 1-9 will be used.