Given an array of integers nums, return the maximum value.
Constraint: Your solution must run in O(n) time. Do not sort the array (sorting is O(n log n)).
nums = [3, 1, 4, 1, 5, 9, 2, 6]9nums = [-5, -2, -8, -1]-1nums = [7]71 <= nums.length <= 10^5-10^9 <= nums[i] <= 10^9Expected time complexity: O(n)Do not use sortRun your code to see results
Use Cmd+Enter to run