From a2f3c6f2d6d4aee3a7d598bdf4b0b8357ac82c93 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 13 Mar 2022 23:35:57 -0400 Subject: [PATCH] [+] Prep9 min_index_sublist --- practice/prep9.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/practice/prep9.py b/practice/prep9.py index 76a17b7..1a3d629 100755 --- a/practice/prep9.py +++ b/practice/prep9.py @@ -120,7 +120,15 @@ def min_index_sublist(lst: list, b: int, e: int) -> int: >>> min_index_sublist([-10, 7, 3, 5], 1, 3) 2 """ - # TODO: implement this function + min = lst[b] + index = b + + for i in range(b, e): + if lst[i] < min: + min = lst[i] + index = i + + return index def cycle(lst: list) -> None: