From f976db3605d141efc4a44ee71ab11049dc5491da Mon Sep 17 00:00:00 2001 From: Divanshu <114694978+dvanhu@users.noreply.github.com> Date: Fri, 8 May 2026 17:17:32 +0530 Subject: [PATCH 1/2] Update type hints for linear search functions --- searches/linear_search.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/searches/linear_search.py b/searches/linear_search.py index 8adb4a7015f0..9b0a9810951e 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -9,7 +9,7 @@ """ -def linear_search(sequence: list, target: int) -> int: +def linear_search(sequence: list[int], target: int) -> int: """A pure Python implementation of a linear search algorithm :param sequence: a collection with comparable items (sorting is not required for @@ -33,7 +33,9 @@ def linear_search(sequence: list, target: int) -> int: return -1 -def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int: +def rec_linear_search( + sequence: list[int], low: int, high: int, target: int +) -> int: """ A pure Python implementation of a recursive linear search algorithm From bf9f4cea7abb870486c0be1571897b4a553ea674 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 11:53:51 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- searches/linear_search.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/searches/linear_search.py b/searches/linear_search.py index 9b0a9810951e..98de2534ee96 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -33,9 +33,7 @@ def linear_search(sequence: list[int], target: int) -> int: return -1 -def rec_linear_search( - sequence: list[int], low: int, high: int, target: int -) -> int: +def rec_linear_search(sequence: list[int], low: int, high: int, target: int) -> int: """ A pure Python implementation of a recursive linear search algorithm