We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 007c291 commit 095850eCopy full SHA for 095850e
find-minimum-in-rotated-sorted-array/sonjh1217.swift
@@ -4,7 +4,7 @@ class Solution {
4
var high = nums.count - 1
5
6
while low <= high {
7
- let mid = (low + high) / 2
+ let mid = low + (high - low) / 2
8
9
if nums[mid] < nums[mid - 1] {
10
return nums[mid]
0 commit comments