PROBLEMS|MOD 06|EASY

Reverse string using recursion

Strings & String Manipulation

Given a string `s`, return the reversed string.

// EXAMPLES

Example 1:
Input: Input: hello
Output: olleh
Explanation: Result for example 1 of Reverse string using recursion.
Example 2:
Input: Input: python
Output: nohtyp
Explanation: Result for example 2 of Reverse string using recursion.

// CONSTRAINTS

  • 1 <= len(input) <= 10^5
  • Time Complexity target: O(N) or O(N log N)
  • Space Complexity target: O(1) or O(N)
  • Evaluated against 100 test cases.
solution.py