Skills101
← All coding problems

Reverse a String

easyBasics+10 XPTime limit 2s

Read a line of text and print it reversed.

Input: one line s (letters, digits and spaces; it never starts or ends with a space).

Output: s reversed.

Constraints: 1 ≤ length of s ≤ 10⁵.

Sample input 1

hello

Sample output 1

olleh

Sample input 2

Skills101

Sample output 2

101sllikS

Read input from standard input and print the answer to standard output. Your code runs in a secure sandbox against the samples (Run) and hidden tests (Submit).

Loading editor…

Log in to run and submit your code — it's free.