Reverse String

Easy
Strings String Two Pointers

Given a string s, return the reversed string.

Constraints

1 ≤ s.length ≤ 10^5

Examples

Example 1:
Input: hello
Output: olleh
Example 2:
Input: Hannah
Output: hannaH

Hints

Use two pointers from both ends.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.