Skip to content
Squarebrackets Private Limited
Squarebrackets
Courses
Browse
Explore
Services
Learning
Prep
Code&Run
Whiteboard
LMS
Problems

Reverse String

Easy1 pt
StringTwo Pointers
PrerequisitesTwo Pointers, String
Return the input string reversed. Input: a single line. Output: the reversed string.
Example 1
Input
hello
Output
olleh
Explanation
For the given input, the program prints exactly this output.
Example 2
Input
squarebrackets
Output
stekcarberauqs
Explanation
A second case — verify your logic handles it too.
Hints
Video
8 lines
Input (stdin)
Expected output · optional
Run checks your code against every example, one by one — all must pass. Type your own input above to run that instead (Run compares it to the expected output if you set one). The full suite is checked on Submit — a failing case reveals its input & expected output.