Comments
On KANCodeforces Round #423 Analysis, 9 years ago
+22

Please test this case

string(499999, 'V') + 'K'

It seems that your solution can't give result in several minutes

I also use FFT