340. Longest Substring with At Most K Distinct Characters [Medium]
/** * Runtime: 19 ms, faster than 31.40% * Memory Usage: 41.2 MB, less than 30.53% */class Solution { public int lengthOfLongestSubstringKDistinct(String s, int k) { HashMap<Character, Integer> map = new HashMap<>(); in.