aboutsummaryrefslogtreecommitdiff
path: root/challenge-242/eric-cheung/python
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2023-11-07 15:11:45 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2023-11-07 15:11:45 +0000
commitdb4d9fe6bf77ff58c31ec3e9d2f71d8acf7d58d4 (patch)
tree75034cff36d02eac8e671171b0f04bf0fe1c31c9 /challenge-242/eric-cheung/python
parent8acd05841cdfa05a5b8d0bc29b9f3395bf3c9778 (diff)
downloadperlweeklychallenge-club-db4d9fe6bf77ff58c31ec3e9d2f71d8acf7d58d4.tar.gz
perlweeklychallenge-club-db4d9fe6bf77ff58c31ec3e9d2f71d8acf7d58d4.tar.bz2
perlweeklychallenge-club-db4d9fe6bf77ff58c31ec3e9d2f71d8acf7d58d4.zip
- Added solutions by Eric Cheung.
- Added solutions by Laurent Rosenfeld. - Added solutions by Mark Anderson. - Added solutions by Matthias Muth. - Added solutions by Athanasius. - Added solutions by Niels van Dijke. - Added solutions by Simon Proctor. - Added solutions by Packy Anderson. - Added solutions by David Ferrone. - Added solutions by W. Luis Mochan. - Added solutions by Thomas Kohler. - Added solutions by Paulo Custodio. - Added solutions by Matthew Neleigh. - Added solutions by Robbie Hatley. - Added solutions by PokGoPun. - Added solutions by Luca Ferrari. - Added solutions by Peter Campbell Smith. - Added solutions by E. Choroba. - Added solutions by Roger Bell_West.
Diffstat (limited to 'challenge-242/eric-cheung/python')
-rwxr-xr-xchallenge-242/eric-cheung/python/ch-1.py20
-rwxr-xr-xchallenge-242/eric-cheung/python/ch-2.py11
2 files changed, 31 insertions, 0 deletions
diff --git a/challenge-242/eric-cheung/python/ch-1.py b/challenge-242/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..b3d79cc846
--- /dev/null
+++ b/challenge-242/eric-cheung/python/ch-1.py
@@ -0,0 +1,20 @@
+
+## Example 1
+## arrNum_01 = [1, 2, 3]
+## arrNum_02 = [2, 4, 6]
+
+## Example 2
+arrNum_01 = [1, 2, 3, 3]
+arrNum_02 = [1, 1, 2, 2]
+
+arrOutput = []
+
+arrOutput_01 = [nLoop for nLoop in list(set(arrNum_01)) if nLoop not in list(set(arrNum_02))]
+if len(arrOutput_01) > 0:
+ arrOutput.append(arrOutput_01)
+
+arrOutput_02 = [nLoop for nLoop in list(set(arrNum_02)) if nLoop not in list(set(arrNum_01))]
+if len(arrOutput_02) > 0:
+ arrOutput.append(arrOutput_02)
+
+print (arrOutput)
diff --git a/challenge-242/eric-cheung/python/ch-2.py b/challenge-242/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..9d487ad23a
--- /dev/null
+++ b/challenge-242/eric-cheung/python/ch-2.py
@@ -0,0 +1,11 @@
+
+arrMatrix = [[1, 1, 0], [0, 1, 1], [0, 0, 1]] ## Example 0
+## arrMatrix = [[1, 1, 0], [1, 0, 1], [0, 0, 0]] ## Example 1
+## arrMatrix = [[1, 1, 0, 0], [1, 0, 0, 1], [0, 1, 1, 1], [1, 0, 1, 0]] ## Example 2
+
+arrOutput = []
+
+for arrLoop in arrMatrix:
+ arrOutput.append([1 - nLoop for nLoop in arrLoop[::-1]])
+
+print (arrOutput)