aboutsummaryrefslogtreecommitdiff
path: root/challenge-338/eric-cheung/python/ch-2.py
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-08 09:10:43 +0100
committerMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-08 09:10:43 +0100
commit1d073851f64d0b9edfb3966c3bf788528e72bbf4 (patch)
treed2d283cd6298811b894f68ea03d155c43a788244 /challenge-338/eric-cheung/python/ch-2.py
parentd3703790885c7629c2546e8fd1b71a2d52e593dc (diff)
downloadperlweeklychallenge-club-1d073851f64d0b9edfb3966c3bf788528e72bbf4.tar.gz
perlweeklychallenge-club-1d073851f64d0b9edfb3966c3bf788528e72bbf4.tar.bz2
perlweeklychallenge-club-1d073851f64d0b9edfb3966c3bf788528e72bbf4.zip
- Added solutions by Andrew Shitov.
- Added solutions by Mark Anderson. - Added solutions by W. Luis Mochan. - Added solutions by Eric Cheung. - Added solutions by Niels van Dijke.
Diffstat (limited to 'challenge-338/eric-cheung/python/ch-2.py')
-rwxr-xr-xchallenge-338/eric-cheung/python/ch-2.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/challenge-338/eric-cheung/python/ch-2.py b/challenge-338/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..f819139317
--- /dev/null
+++ b/challenge-338/eric-cheung/python/ch-2.py
@@ -0,0 +1,24 @@
+
+## Example 1
+## arrInput_01 = [4, 5, 7]
+## arrInput_02 = [9, 1, 3, 4]
+
+## Example 2
+## arrInput_01 = [2, 3, 5, 4]
+## arrInput_02 = [3, 2, 5, 5, 8, 7]
+
+## Example 3
+## arrInput_01 = [2, 1, 11, 3]
+## arrInput_02 = [2, 5, 10, 2]
+
+## Example 4
+## arrInput_01 = [1, 2, 3]
+## arrInput_02 = [3, 2, 1]
+
+## Example 5
+arrInput_01 = [1, 0, 2, 3]
+arrInput_02 = [5, 0]
+
+nMaxDiff = max(abs(nElem_01 - nElem_02) for nElem_01 in arrInput_01 for nElem_02 in arrInput_02)
+
+print (nMaxDiff)