From 39d4a76d5b352976cbb0916e410ead016380d346 Mon Sep 17 00:00:00 2001 From: deadmarshal Date: Sun, 7 Jan 2024 00:52:52 -0500 Subject: Extra solutions for TWC250 --- challenge-250/deadmarshal/python/ch1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 challenge-250/deadmarshal/python/ch1.py (limited to 'challenge-250/deadmarshal/python/ch1.py') diff --git a/challenge-250/deadmarshal/python/ch1.py b/challenge-250/deadmarshal/python/ch1.py new file mode 100644 index 0000000000..ffe8ecb00a --- /dev/null +++ b/challenge-250/deadmarshal/python/ch1.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +def smallest_index(arr): + for i in range(0,len(arr)): + if i % 10 == arr[i]: return i + return -1 + +print(smallest_index([0,1,2])) +print(smallest_index([4,3,2,1])) +print(smallest_index([1,2,3,4,5,6,7,8,9,0])) + -- cgit