Write a function to reverse the order of words in a string.
HardProblem Statement
Write a function to reverse the order of words in a string.
Sample Input
A hardcoded string, e.g., "Kotlin is awesome"
Sample Output
Reversed words: awesome is Kotlin
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
fun reverseWords(input: String): String {
// Add your code here to reverse the words
}
fun main() {
val input = "Kotlin is awesome"
println("Reversed words: ${reverseWords(input)}")
}
Input
A hardcoded string, e.g., "Kotlin is awesome"
Expected Output
Reversed words: awesome is Kotlin