Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. while exists words:
  2. if first word == second word:
  3. exit()
  4. i := start of first word
  5. j := start of last word
  6. if length of first word != length of last word:
  7. MAGIC_SPECIAL_CASE()
  8. len := length of first word
  9. for len: swap(str[i++], str[j--])
  10. bounds are now second word and second last word
Add Comment
Please, Sign In to add comment