solulubeta
Sign in
Recursion & Memo / See it, then write it
01.06 · Problem

Reverse a String

Easy Build on the way back up Pro

Return s written backwards. Use recursion, not a loop or StringBuilder.reverse().

Examples

Example 1

Input:  s = "abc"
Output: "cba"

Example 2

Input:  s = "a"
Output: "a"
solulu Pro

Continue this problem with Pro

Inside: step-by-step hints · 9 hidden tests · reference solutions · code editor.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 6 of 44 · updated 2026-10-13