RGB Substring (hard version) CodeForces - 1196D2

NoSuchKey