Solution is similar to editorial, still not going through

Hi, I happened to solve this problem first on my own, but was not able to pass 3 test cases out of 4. When seeing the editorial, the code appears to be similar to what I had written. Please look into it.

Code Link : https://ide.codingblocks.com/s/213203

line 17 use >= instead of >