diff options
Diffstat (limited to 'challenge-250/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-250/eric-cheung/python/ch-1.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-250/eric-cheung/python/ch-1.py b/challenge-250/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..3f0e3c37c1 --- /dev/null +++ b/challenge-250/eric-cheung/python/ch-1.py @@ -0,0 +1,10 @@ +
+## arrInt = [0, 1, 2] ## Example 1
+## arrInt = [4, 3, 2, 1] ## Example 2
+arrInt = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] ## Example 3
+
+arrOutput = [nIndx for nIndx in range(len(arrInt)) if nIndx % 10 == arrInt[nIndx]]
+if len(arrOutput) > 0:
+ print (arrOutput[0])
+else:
+ print (-1)
|
