aboutsummaryrefslogtreecommitdiff
path: root/challenge-257/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-257/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-257/eric-cheung/python/ch-1.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/challenge-257/eric-cheung/python/ch-1.py b/challenge-257/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..5b438b92e1
--- /dev/null
+++ b/challenge-257/eric-cheung/python/ch-1.py
@@ -0,0 +1,9 @@
+
+## arrInt = [5, 2, 1, 6] ## Example 1
+## arrInt = [1, 2, 0, 3] ## Example 2
+## arrInt = [0, 1] ## Example 3
+arrInt = [9, 4, 9, 2] ## Example 4
+
+arrOutput = [len([arrInt[nColLoop] for nColLoop in range(len(arrInt)) if nColLoop != nRowLoop and arrInt[nColLoop] < arrInt[nRowLoop]]) for nRowLoop in range(len(arrInt))]
+
+print (arrOutput)