Max Stack
Advanced Python: Decorators, Generators & Context Managers
Given a non-empty list of numbers `arr`, return the maximum value.
// EXAMPLES
Example 1:
Input:
Input: [3, 5, 2, 8, 1]Output:
8Explanation: Result for example 1 of Max Stack.
Example 2:
Input:
Input: [-10, -3, -20]Output:
-3Explanation: Result for example 2 of Max Stack.
// CONSTRAINTS
-10^9 <= n <= 10^9Time Complexity target: O(N) or O(N log N)Space Complexity target: O(1) or O(N)Evaluated against 600 test cases.
solution.py