Given a string S, we need to find reciprocal of it. The reciprocal of the letter is found by finding the difference between the position of the letter and first letter ‘A’. Then moving the same number of steps from letter ‘Z’. The character that we reach after above steps is reciprocal.
Reciprocal of Z is A and vice versa because if you reverse the position of the alphabet A will be in the position of Z.
Similarly, T is the reciprocal of G, J is the reciprocal of Q.
Input : PRAKHAR Output : KIZPSZI Input : VARUN Output : EZIFM
Just use a mathematical formula which gives the reciprocal of each character
Reciprocal(x) = ASCII(‘Z’) – ASCII(x) + ASCII(‘A’)
The ASCII value of Z and A will change according
to the uppercase and lowercase.
The reciprocal of Geeks for Geeks is - Tvvph uli Tvvph
- Put spaces between words starting with capital letters
- Length of the longest substring with no consecutive same letters
- Check if the string contains consecutive letters and each letter occurs exactly once
- Smallest Greater (than S) String of length K whose letters are subset of S
- Minimum number of letters needed to make a total of n
- Regex in Python to put spaces between words starting with capital letters
- Minimum letters to be removed to make all occurrences of a given letter continuous
- Program to print last N lines | Set-2
- Sort numbers based on count of letters required to represent them in words
- Program to print the initials of a name with the surname
- Program to print Step Pattern
- Program to print all substrings of a given string
- Program to print all palindromes in a given range
- Program to print the given digit in words
- Program to print Even Odd Number Pyramid
- Program to print ASCII Value of a character
- Write a program to print all permutations of a given string
- Java Program to print distinct permutations of a string
- C program to print the length of a String using %n format specifier
- Java program to print Even length words in a String