Problem: https://codeforces.net/contest/245/problem/H
My solution: https://codeforces.net/contest/245/submission/49911945
Editorial solution: https://codeforces.net/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?