maxDigit to the NUL character \0.num from index 0 to len(num) - 3.
i, check if num[i], num[i + 1], and num[i + 2] are the same.maxDigit to the maximum of maxDigit and num[i].maxDigit is still the NUL character.
maxDigit characters.