Longest Substring With Exactly N Distinct Characters
Given a string s and an integer N, return the longest substring of s that contains exactly N distinct characters (the substring must be contiguous). If several answers have the same length, re...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
