โ† UBS questions

Reverse a string iteratively, recursively, and in-place

Filed under UBS

The question

Implement a function to reverse a string. First provide an iterative solution, then rewrite it recursively, and finally implement it without allocating auxiliary memory.

No write-up yet. Related questions below have one.

Related UBS questions

Collected from public candidate posts and coding forums. Updated Nov 2026.