Skip to content

Latest commit

 

History

History
13 lines (7 loc) · 489 Bytes

File metadata and controls

13 lines (7 loc) · 489 Bytes

Daily Coding Problem

Note: Continuous improvements and bug fixes are made within the repository to produce better solutions.

Day 13

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", so your function should return 3.

This problem was asked by Amazon.

Solution | Tests