This question was asked in InterviewBit Academy Entrance Test on 16 Feb.
Given a string A of size N consisting of lowercase alphabets.
You can change at most B characters in the given string to any other lowercase alphabet such that the number of distinct characters in the string is minimized.
Find the minimum number of distinct characters in the resulting string.
Constraints :
1 \leq N \leq 10^{5}
0 \leq B \leq N
Input :
String A
Integer B
Output :
Integer denoting minimum number of distinct characters in the string.
Please help.