From 11d3736ea230f3db841584aa1a55988d851bb61e Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 23 Oct 2023 19:31:53 +0100 Subject: - Added solutions by Robert DiCicco. - Added solutions by Ulrich Rieke. - Added solutions by Eric Cheung. - Added solutions by Mark Anderson. - Added solutions by Niels van Dijke. - Added solutions by Peter Meszaros. - Added solutions by PokGoPun. - Added solutions by E. Choroba. - Added solutions by Lubos Kolouch. - Added solutions by Steven Wilson. - Added solutions by David Ferrone. - Added solutions by W. Luis Mochan. - Added solutions by Dave Jacoby. - Added solutions by Humberto Massa. --- challenge-240/eric-cheung/python/ch-1.py | 16 ++++++++++++++++ challenge-240/eric-cheung/python/ch-2.py | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100755 challenge-240/eric-cheung/python/ch-1.py create mode 100755 challenge-240/eric-cheung/python/ch-2.py (limited to 'challenge-240/eric-cheung/python') diff --git a/challenge-240/eric-cheung/python/ch-1.py b/challenge-240/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..0cc518455d --- /dev/null +++ b/challenge-240/eric-cheung/python/ch-1.py @@ -0,0 +1,16 @@ + +## Example 1 +## arrStrInput = ["Perl", "Python", "Pascal"] +## strCheck = "ppp" + + +## Example 2 +## arrStrInput = ["Perl", "Raku"] +## strCheck = "rp" + + +## Example 3 +arrStrInput = ["Oracle", "Awk", "C"] +strCheck = "oac" + +print ("".join([strLoop[0].lower() for strLoop in arrStrInput]) == strCheck) diff --git a/challenge-240/eric-cheung/python/ch-2.py b/challenge-240/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..409146c3f4 --- /dev/null +++ b/challenge-240/eric-cheung/python/ch-2.py @@ -0,0 +1,7 @@ + +## arrInput = [0, 2, 1, 5, 3, 4] ## Example 1 +arrInput = [5, 0, 1, 2, 3, 4] ## Example 2 + +arrOutput = [arrInput[arrInput[nIndx]] for nIndx in range(len(arrInput))] + +print (arrOutput) -- cgit