D2. RGB Substring (hard version)inputstandard inputoutputstandard outputThe only difference between easy and hard versions is the size of the input.You are given a string