I was solving a question [Weird Sum](https://mirror.codeforces.com/problemset/problem/1648/A), I wrote a solution and according to me it was within the constraints. It passed sample test cases on VS code but when I submitted it on the codeforces it gave TLE on the sample test case only. I tried changing the version of G++ and it worked. It got accepted on G++17. However, I cannot understand what my mistake was and what the improvements could be. ↵
↵
(Here's my submission: https://mirror.codeforces.com/contest/1648/submission/300963112)
↵
(Here's my submission: https://mirror.codeforces.com/contest/1648/submission/300963112)