diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-09-08 09:10:43 +0100 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-09-08 09:10:43 +0100 |
| commit | 1d073851f64d0b9edfb3966c3bf788528e72bbf4 (patch) | |
| tree | d2d283cd6298811b894f68ea03d155c43a788244 /challenge-338/eric-cheung/python/ch-2.py | |
| parent | d3703790885c7629c2546e8fd1b71a2d52e593dc (diff) | |
| download | perlweeklychallenge-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-x | challenge-338/eric-cheung/python/ch-2.py | 24 |
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)
|
