Problem: https://mirror.codeforces.com/contest/245/problem/H
My solution: https://mirror.codeforces.com/contest/245/submission/49911945 Editorial solution: https://mirror.codeforces.com/contest/245/submission/2622404
Both of the codes look exactly the same, and have the same logic. Yet mine is TLE. Could anyone please help me understand why that is the case?