Getting TLE on test case 8 for [this problem](https://codeforces.me/problemset/problem/1295/C). I read the editorial which had O(n) complexity. [My soln](http://https://codeforces.me/problemset/status?friends=oncontest/1295/submission/85271178) has a complexity of O(n *log n) but as n has an upper bound of 2e5 it should pass right (if it is correct)?↵