LC340 Longest Substring with At Most K Distinct Characters

用HashMap + slinding window的思想 每次都保持k size个的hashmap,一旦超过k,就把位置最左边的元素移除,此时update一下最大值