Problem Description
Write a function that takes in a sentence (a string of words separated by spaces) and returns a new string with the words in reversed order. The characters within each word should remain in the same order.
For example:
"Hello world from May 15"
"15 May from world Hello"
Note:
In celebration of International Families Day on May 15, imagine reversing the order of family members' names in an invitation card for a fun twist!
Function Signature (pseudo-code):
function reverseWords(sentence: string) -> string
Your solution should run in O(n) time complexity, where n is the length of the sentence.