← All problemsSign in

Reverse

Krishna just learned how to reverse a string. Now he is wondering is there any way to reverse the first half of string and then reverse the second half of the string. For example, if $s = "abcdef"$ after reversing the first and second half string $s$ will be $"cbafed"$. If the length of the string is Odd, ignore the middle character. ###Input You are given a string $s (1<=s<=10^5)$. ###Output P

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start