Find longest uniform substring after k replacements | Apple