Problem
Given a string word, write a function solution that returns the reversed version of the string.
Constraints
wordconsists only of lowercase English letters.- The length of
wordis between 1 and 100 inclusive.
Test Case
| Test Case Number | word | return |
|---|---|---|
| 1 | "hello" | "olleh" |
| 2 | "algorithm" | "mhtirogla" |
| 3 | "python" | "nohtyp" |
Explanation for Test Case 1
- When
word = "hello", reversing the string yields"olleh".
Explanation for Test Case 2
- When
word = "algorithm", reversing the string yields"mhtirogla".
Explanation for Test Case 3
- When
word = "python", reversing the string yields"nohtyp".