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