Given a string str and an integer k, determine if it is possible to transform the string into a pangram using at most k operations.
An operation consists of swapping any alphabetic character in the string with another lowercase alphabetic character.
Note: A pangram is a sentence that contains every letter of the English alphabet at least once.
Example 1
Input: str = "the quick brown fox jumps over the lazy dog", k = 0
Output: true
Explanation: the sentence contains all 26 characters and is already a pangram.
Example 2
Input: str = "aaaaaaaaaaaaaaaaaaaaaaaaaa", k = 25
Output: true
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.
Sign in to write, run, and submit your solution against the full test suite.