Longest Substring With At Most K Distinct Characters