Skip to content

thecrood/Daily-Coding-Problem-13

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Daily-Coding-Problem-13

Daily Coading Problem Challenge

This problem was asked by Amazon.

Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters.

For example, given s = "abcba" and k = 2, the longest substring with k distinct characters is "bcb".

Input: S = "eceba" and k = 3 Output: 4 Explanation: T = "eceb"

Input: S = "WORLD" and k = 4 Output: 4 Explanation: T = "WORL" or "ORLD"