Given a strings and an integer D. The task is to determine the length of the longest palindromic string P that can be prepared using D distinct characters of string S such that the frequency of any character C in string P is at most the frequency of the same character in the string S.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Given a strings and an integer D. The task is to determine the length of the longest palindromic string P that can be prepared using D distinct characters of string S such that the frequency of any character C in string P is at most the frequency of the same character in the string S.