Description:
Solution:
I set the right and left pointers to the end of the array.
m is the pivot(first set the middle of the array).
If m is more than l, then we can throw out the left portion. Now, the new l is the next value of m.
Else, we can throw out the right portion, so the new r is the previous value of m.
When we get the nums[l] is less than nums[r], we return the res.
'LeetCode ๐๏ธ > Array' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
15. 3Sum (0) | 2023.05.31 |
---|---|
33. Search in Rotated Sorted Array (0) | 2023.05.30 |
152. Maximum Product Subarray (0) | 2023.05.28 |
53. Maximum Subarray (0) | 2023.05.27 |
238. Product of Array Except Self (0) | 2023.01.29 |