Description:
Solution:
tmp will be used for curMin.
Example: [-1, -2, -3]
nums[i]= -2:
tmp = 2, curMax = 2, curMin = -2 -> res = 2
nums[i] = -3:
tmp = -6, curMax = 6, curMin = -6 -> res = 6
โป Think about all negative integers array case!
'LeetCode ๐๏ธ > Array' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
33. Search in Rotated Sorted Array (0) | 2023.05.30 |
---|---|
153. Find Minimum in Rotated Sorted Array (0) | 2023.05.29 |
53. Maximum Subarray (0) | 2023.05.27 |
238. Product of Array Except Self (0) | 2023.01.29 |
217. Contains Duplicate (0) | 2023.01.28 |