diff --git a/data_structures/arrays/search_range.py b/data_structures/arrays/search_range.py index 0e9d423fe..74d37ba6a 100644 --- a/data_structures/arrays/search_range.py +++ b/data_structures/arrays/search_range.py @@ -27,7 +27,7 @@ def search_range(nums: list[int], target: int) -> list[int]: [1, 1] """ - def binary_search(nums, target, left): + def binary_search(nums:list, target:int, left:int): low, high = 0, len(nums) - 1 index = -1 while low <= high: diff --git a/maths/lexographical_numbers.py b/maths/lexographical_numbers.py index 88c3baa07..40f610e81 100644 --- a/maths/lexographical_numbers.py +++ b/maths/lexographical_numbers.py @@ -8,7 +8,7 @@ Leetcode reference: https://leetcode.com/problems/lexicographical-numbers/ """ -def lexical_order(n: int) -> list[int]: +def lexical_order(num: int) -> list[int]: """ >>> lexical_order(13) [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9] @@ -21,7 +21,7 @@ def lexical_order(n: int) -> list[int]: of characters according to their position in the alphabet. """ - numbers = [str(i) for i in range(1, n + 1)] + numbers = [str(i) for i in range(1, num + 1)] numbers.sort() res = list(map(int, numbers)) return res