Throughout the year, Google Code Jam hosts online Kickstart rounds to give students the opportunity to develop their coding skills, get acquainted with Code Jam’s competition arena, and get a glimpse into the programming skills needed for a technical career at Google.

Seems like APAC is still using the old way of judging solutions: downloading/uploading i/o files. I am saying "old" cause I heard CodeJam will be shifting to the traditional method of submitting source code and running it on their server for judging.

When you move one position to right, frequency of one character increases and that of another decreases. You just account for this change and update the hash. This takes overall O(N) for a particular length.

I don't think so. For large dataset, my code runs in 11s, and we have 8 minutes. Link to code

EDIT : A possible reason for TLE is that when you access map using operator [], you also insert the element and it might increase the size of your map to , which is a little too much. For example, if I remove the 61st line from my code, it would give TLE

Problem A can be solved without implementing both decrease and increase case. I'm surprised that this is not mentioned in the editorial. This trick is really important to reduce complex implementation.

When you implemented decrease case as solve(n), you can calculate increase case by solve(8888888888888888 — n).