Max Function Time Complexity In Python Code For Snake