mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-03 10:40:15 +08:00
Merge branch 'master' of github.com:krahets/hello-algo
This commit is contained in:
@@ -490,7 +490,7 @@ comments: true
|
||||
func medianThree(nums []int, left, mid, right int) int {
|
||||
if (nums[left] < nums[mid]) != (nums[left] < nums[right]) {
|
||||
return left
|
||||
} else if (nums[mid] < nums[left]) != (nums[mid] > nums[right]) {
|
||||
} else if (nums[mid] > nums[left]) != (nums[mid] > nums[right]) {
|
||||
return mid
|
||||
}
|
||||
return right
|
||||
|
||||
Reference in New Issue
Block a user