Question 6

Given a string, find the longest substring with k distinct characters.

e.g – “aaaabbbb”, k = 2, “aaaabbbb”

“asdfrttt” k = 3, “asd”, “frttt”

[advanced_iframe securitykey=”undefined” src=”https://code.kodnest.com/” width=”100%” height=”600″]

KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report

Close