You are given a string. Find the length of the longest substring that contains no more than k unique characters.
Example 1: Input: word = "abbcde", k = 2 Output: 3 Explanation: The substring "abb" has length 3 and contains at most 2 distinct characters. Example 2: Input: word = "bbbb", k = 1 Output: 4 Explanation: The entire string "bbbb" has only 1 unique character.