Python Max Function Time Complexity