Given a string and a number N, we need to mirror the characters from N-th position up to the length of the string in the alphabetical order. In mirror operation, we change ‘a’ to ‘z’, ‘b’ to ‘y’, and so on.
Input : N = 3 paradox Output : paizwlc We mirror characters from position 3 to end. Input : N = 6 pneumonia Output : pnefnlmrz
We have existing solution for this problem please refer Mirror characters of a string link. We can solve this problem in Python using Dictionary Data Structure. Mirror value of ‘a’ is ‘z’,’b’ is ‘y’ etc, so we create a dictionary data structure and one-to-one map reverse sequence of alphabets onto original sequence of alphabets. Now traverse characters from length k in given string and change characters into it’s mirror value using dictionary.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Find largest word in dictionary by deleting some characters of given string
- Mirror characters of a string
- Find the first repeated word in a string in Python using Dictionary
- Python Counter| Find all duplicate characters in string
- Python | Convert string dictionary to dictionary
- Given a sorted dictionary of an alien language, find order of characters
- Python | Words extraction from set of characters using dictionary
- Find Kth largest string from the permutations of the string with two characters
- Find the smallest window in a string containing all characters of another string
- Python - Remove front K characters from each string in String List
- Python - Convert key-value String to dictionary
- Python | Converting list string to dictionary
- Python program to create a dictionary from a string
- Python - Convert Dictionary to Concatenated String
- Python - Concatenate Dictionary string values
- Python | Convert dictionary object into string
- Python | Converting String content to dictionary
- Find if string is K-Palindrome or not using all characters exactly once
- Python - Concatenate String values in Dictionary List
- Python - Dictionary values String Length Summation
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.