1. Engineering
  2. Computer Science
  3. for a given string s the function change n m...

Question: for a given string s the function change n m...

Question details

For a given string S, the function change (n, m) replaces all 'n' with 'm' in string S. For example, if S = "alopecia", change (a, b) will give the string "blopecib". You need to find the minimum number of uses of change (n, m) such that the string S forms a palindrome. ​ I'm looking for a O(length(S)) solution. Preferably JAVA.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution