From 2e0c3a3f01f34bee3261b56a4405d56d1546072c Mon Sep 17 00:00:00 2001 From: Aditya Mitra <216041780+Aditya70-creator@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:22:30 +0530 Subject: [PATCH 1/2] style: add explicit type hints to linear_search.py --- searches/linear_search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/searches/linear_search.py b/searches/linear_search.py index 8adb4a7015f0..b3880ee84d6b 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -7,9 +7,9 @@ For manual testing run: python3 linear_search.py """ +from typing import Any - -def linear_search(sequence: list, target: int) -> int: +def linear_search(sequence: list[Any], target: Any) -> 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,7 @@ 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[Any], low: int, high: int, target: Any) -> int: """ A pure Python implementation of a recursive linear search algorithm From d0e52da86909170609c822f7076ddca101eade95 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:05:25 +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, 3 insertions(+), 1 deletion(-) diff --git a/searches/linear_search.py b/searches/linear_search.py index b3880ee84d6b..b8d7d0a58094 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -7,7 +7,9 @@ For manual testing run: python3 linear_search.py """ -from typing import Any + +from typing import Any + def linear_search(sequence: list[Any], target: Any) -> int: """A pure Python implementation of a linear search algorithm