All tasks
Easystringsloops

Swap Letter Case

Time limit 2 s · Memory 64 MBAcceptance: —Solved by: 0

Statement

You are given one line of Latin letters and spaces. Print it with every uppercase letter turned lowercase and every lowercase letter turned uppercase. Spaces stay unchanged.

Examples

Example 1
Input
Hello
Output
hELLO
Example 2
Input
aBc DeF
Output
AbC dEf

Constraints

  • String length is between 1 and 10^5
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.