Game with String
Difficulty: Medium
Acceptance: %
Points: 30.00
Given a string str consisting of lowercase alphabets and a number k, the task is to find the minimum possible value of the string after removing k characters. The value of a string is defined as the sum of the squares of the frequencies of each distinct character in the string. Your goal is to return the minimum value that can be achieved after removing exactly k characters.
Expected Time Complexity: O(n+klog(p))
Expected Auxiliary Space: O(n)