Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func findMin(nums []int) int {
- l,r:=0,len(nums) -1
- res:=nums[0]
- for l<=r {
- if nums[l] < nums[r] {
- res = min(res,nums[l])
- break
- }
- m:=(l+r)/2
- res = min(res,nums[m])
- if nums[m] >= nums[l] {
- l = m + 1
- }else {
- r = m - 1
- }
- }
- return res
- }
- func min(l,r int) int {
- if l> r{
- return r
- }
- return l
- }
Advertisement
Comments
-
- Filter bypass tests if u want them for pastes:
- І Love dісk so much і just want to rіde іt all day long~
- God does dісk сumming іnsіde of me feel so good darlіng~..
- F..fuск dаrlіng-.. You impаle my ѵіrgіnа sо gооd-..!
Add Comment
Please, Sign In to add comment
Advertisement