Skip to content

Commit 432381e

Browse files
Update pythonCreate: 374-Guess-Number-Higher-or-Lower.py
I have changed the spacing .
1 parent 38f7021 commit 432381e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
class Solution:
22
def guessNumber(self, n: int) -> int:
33
# return a num btw 1,..,n
4-
low=1
5-
high=n
4+
low = 1
5+
high = n
66
while True:
7-
mid=low+(high-low)//2
8-
myGuess=guess(mid)
9-
if myGuess==1:
10-
low=mid+1
11-
elif myGuess==-1:
12-
high=mid-1
7+
mid = low + (high - low)//2
8+
myGuess = guess(mid)
9+
if myGuess == 1:
10+
low = mid + 1
11+
elif myGuess == -1:
12+
high = mid - 1
1313
else:
1414
return mid

0 commit comments

Comments
 (0)