I was trying to solve this problem [problem:1851E], and I submitted this code [submission:233066590]. It's the same logic of the editorial, that's what I think, but it's getting TLE. Can anyone tell me what is the wrong with my code so it's getting this TLE?