Given a string str and an integer K, find whether the string can be changed into a pangram after at most k operations. A pangram is a sentence containing every letter in the english alphabet. A single operation can be used to swap an existing alphabetic character with any other alphabetic character.
str = "the quick brown fox jumps over the lazy dog"
k = 0
Explanation: the sentence contains all 26 characters
and is already a pangram.
str = "aaaaaaaaaaaaaaaaaaaaaaaaaa"
k = 25
Explanation: The word contains 26 instances of 'a'.
Since only 25 operations are allowed. We can keep
1 instance and change all others to make str a pangram.
You dont need to read input or print anything. Complete the function kPangram() which takes str and k as input parameters and returns a boolean value which denotes if pangram is possible or not.
Expected Time Complexity: O(N) where N is length of str. Expected Auxiliary Space: O(1)
1<= N <= 104
String may contain duplicate characters.
String can contain only lowercase alphabets or space.