Ad
Fundamentals
Strings
Code
Diff
  • def reverse_string(string):
        return ''.join(reversed(list(string)))
    • from collections import deque
    • def reverse_string(string):
    • reversed_str = deque("")
    • [reversed_str.appendleft(letter) for letter in string]
    • return "".join(reversed_str)
    • return ''.join(reversed(list(string)))