Time limit exceeded - works fine on my machine

Solved Alien chefs problem and ran it on my machine. It’s working fine. But here it gives time limit exceeded error. My solution is here. If it’s really running slow, how to make it fast?

Actually the thing which makes your program slow is the function call. The more you call any function the slower you program will be. So i think you should reduce the use of functions. Hope this will help you! :slight_smile:

1 Like

Maybe yours is a supercomputer (lol).

1 Like