It's O(n), since it must check every element. If you want better performance for max, you can use the heapq module. However, you have to negate each value, since heapq
provides a min heap. Inserting an element into a heap is O(log n).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…