Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters.
Example:
>>> coding_problem_13('abcba', 2) # longest substring with at most 2 distinct characters is 'bcb'
3
>>> coding_problem_13('edabccccdccba', 3) # 'bccccdccb'
9