Back to exercises

Reverse String

Use slicing with a step of -1 for the shortest solution, or iterate from the end if the interviewer wants the mechanics.

Coding Exercises Easy O(n)

Reverse String

Use slicing with a step of -1 for the shortest solution, or iterate from the end if the interviewer wants the mechanics.

Write a function that returns the input string reversed.