Strongest Fighter Last TC getting TLE

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

Please check why am i getting TLE. Used deque for implementation. Thank you in advance.

Refer this TLE for the last test case