Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while exists words:
- if first word == second word:
- exit()
- i := start of first word
- j := start of last word
- if length of first word != length of last word:
- MAGIC_SPECIAL_CASE()
- len := length of first word
- for len: swap(str[i++], str[j--])
- bounds are now second word and second last word
Add Comment
Please, Sign In to add comment