In 1v1 challenge While running the code, it takes a lot of time, or sometimes it doesn't run

While running the code, it takes a lot of time, or sometimes it doesn’t run. Due to this bug i have submit the code and not able to figure out the mistakes.

Screenshot

Additional info