Alphabet Mirror
Easy
string
character-manipulation
Problem Description
Replace each letter with its "mirror" from the alphabet. A mirrors to Z, B mirrors to Y, C mirrors to X, and so on. Preserve case and non-alphabetic characters.
Input Format
A single line containing a string.
Output Format
The string with each letter replaced by its alphabet mirror.
Constraints
1 <= string length <= 1000
String may contain letters, digits, spaces, and special characters
Sample Input/Output
Input:
abc
Output:
zyx
Explanation
a (1st letter) → z (26th letter), b (2nd letter) → y (25th letter), c (3rd letter) → x (24th letter).
Solution Hints
- Read carefully: Understand input/output format and constraints
- Start simple: Think of brute force solution first, then optimize
- Edge cases: Consider empty inputs, single elements, max constraints
- Data structures: Choose arrays, hash maps, sets based on problem needs
- Time complexity: Ensure your solution fits within time limits
- Test examples: Verify logic with provided sample inputs
70
Points
Points
2000ms
Time Limit
Time Limit
256MB
Memory Limit
Memory Limit
Code Editor
Register to Access Code Editor
Create a free account to solve coding problems and track your progress.
Register Now