Apple Test Engineer 店面

Write a code to reverse a string:-

“How Are you” - > “you Are How”

“How how Are HOW You are you” - > “You Are How”

If words are repeated, the first occurence should be considered.