Longest Substring with At Most K Distinct Characters (Facebook Interview 02/2019)

Longest Substring with At Most K Distinct Characters (Facebook Interview 02/2019)

This question was asked in Facebook Interview Source: (https://www.techiedelight.com/find-longest-substring-containing-k-distinct-characters/) Given a string you need to print longest possible substring that has exactly M unique characters. If there are more than one substring of longest possible length, then print any one of them. Examples: “aabbcc”, k = 1 Max substring can be any one from {“aa” […]