← All problemsSign in

Reverse only alphabets(letters) in a string

Problem Name : Reverse only alphabets(letters) in a string. Problem description : Given a string, that contains special character together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string in a way that special characters are not affected. Example: Input : "c,a$t" Output : "t,a$c" Note that $ and , are not moved anywhere. Only subsequence "cat" is reversed. Input : "Vo,i,la!

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