Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Input string: "hello world"
  2. Identify each word: "[hello] [world]"
  3. Identify the first and last letters of each word: "[[h]ell[o]] [[w]orl[d]]"
  4. Swap the first letters of each word: "[[o]ell[h]] [[d]orl[w]]"
  5. Final string: "oellh dorlw"
  6.  
  7. "swap the first and last letters of each word" -> "pwas eht tirsf dna tasl setterl fo hace dorw"
  8. "hello world" -> "oellh dorlw"
  9. "test cases" -> "test sasec"
  10. "programming puzzles and code golf" -> "grogramminp suzzlep dna eodc folg"
  11. "in a green meadow" -> "ni a nreeg weadom"
  12. "yay racecar" -> "yay racecar"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement