Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Input string: "hello world"
- Identify each word: "[hello] [world]"
- Identify the first and last letters of each word: "[[h]ell[o]] [[w]orl[d]]"
- Swap the first letters of each word: "[[o]ell[h]] [[d]orl[w]]"
- Final string: "oellh dorlw"
- "swap the first and last letters of each word" -> "pwas eht tirsf dna tasl setterl fo hace dorw"
- "hello world" -> "oellh dorlw"
- "test cases" -> "test sasec"
- "programming puzzles and code golf" -> "grogramminp suzzlep dna eodc folg"
- "in a green meadow" -> "ni a nreeg weadom"
- "yay racecar" -> "yay racecar"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement