Intel Corporation interview question

Reverse sentence problem from leetcode