Company: Deutsche_Bank_IIT_Guwahati (Graduate Analyst role)
Difficulty: medium
Maximum Number of 3-Lettered Palindromes Problem Description You are given a string s of lowercase English letters. Using the letters of s , build as many 3-letter palindromic words as possible. A 3-letter palindromic word has the form X Y X : its first and third letters are equal, and the middle letter Y may be any letter (it may also be equal to X ). Every occurrence of a letter in s may be used in at most one word, and letters may be left unused. The words do not have to appear in s as substrings - only the letters matter. Report the maximum number of such words that can be formed. Function Description Complete the function max3LetterPalindromes() . It has the following parameter and returns the answer: s : a string of lowercase English letters. Returns an integer: the maximum number of 3-letter palindromes that can be built from the letters of s . Input Format For Custom Testing The only line contains the string s . Output Format Print a single integer, the maximum number of 3-lett