Given a string S. Find a string R which is an anagram of S and the hamming distance between S and R is maximum.
An anagram of a string is another string that contains the same characters, only the order of characters can be different.
Hamming distance between two strings of equal length is the number of positions at which the corresponding character is different.
Input
The first and the only line of input contains a single string S.
Constraints:
1 <= |S| <= 100000
S contains only lowercase letters of the English alphabet.
Output
Print the maximum hamming distance between S and R.
Answers
Answered by
0
Answer:
You are given two strings of equal length, you have to find the Hamming Distance between these string.
Where the Hamming distance between two strings of equal length is the number of positions at which the corresponding character is different.
Explanation:
Examples:
Input : str1[] = "geeksforgeeks", str2[] = "geeksandgeeks"
Output : 3
Explanation : The corresponding character mismatch are highlighted.
"geeksforgeeks" and "geeksandgeeks"
Similar questions