Objective: Write a function that takes a string as input and returns the string with the order of the words reversed. This version of the challenge does not involve handling punctuation.
Details:
Input: A string containing words.
Output: The string with the order of the words reversed.
Examples:
Input: "Hello world" Output: "World hello"
Input: "This is a test" Output: "Test a is this"
Input: "Can you solve this challenge" Output: "Challenge this solve you can"
Input: “Is this a fun place to work, or what!” Output: “What or work, to place fun a this Is!”
Constraints:
The string will contain a minimum of 2 words and a maximum of 50 words.
Words are defined as sequences of characters separated by spaces.
Spaces between words should be preserved as in the original string.
include("test_worldwhirl.jl")
test_reverseWithPunctuation()
or
using Test
include("test_worldwhirl.jl")
@testset begin
@test_reverseWithPunctuation()
# Add more test functions if needed
end