Longest Subarray with K Unique Characters
Medium

Problem Statement

Given a string, find the length of the longest substring that contains at most K unique characters.

Examples

1Example 1
Input:
{ "s": "aabacbebebe", "k": 3 }
Output:
7
2Example 2
Input:
{ "s": "araaci", "k": 2 }
Output:
4
3Example 3
Input:
{ "s": "world", "k": 4 }
Output:
4
Loading...

Sign in to Run Code and Submit