Skip to content

Commit 90f66df

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 08c2971 commit 90f66df

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

data_structures/Binary search algo/first_and_last_positon_sorted_array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def find_bound(is_first):
2020
last = find_bound(False)
2121
return [first, last]
2222

23+
2324
# Test
2425
nums = [5, 7, 7, 8, 8, 10]
2526
target = 8

data_structures/Binary search algo/search_insert_position.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def searchInsert(nums, target):
22
left, right = 0, len(nums) - 1
3-
3+
44
while left <= right:
55
mid = (left + right) // 2
66
if nums[mid] == target:
@@ -11,6 +11,7 @@ def searchInsert(nums, target):
1111
right = mid - 1
1212
return left # insertion point
1313

14+
1415
# Test
1516
nums = [1, 3, 5, 6]
1617
target = 5

0 commit comments

Comments
 (0)