diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2023-01-29 13:57:29 +0000 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2023-01-29 13:57:29 +0000 |
| commit | ff9c2dc64f984f4e5be20ce7b492f02966cd2439 (patch) | |
| tree | 9bdd5d96cf49c686532dfca1287ab455dc0ac4f8 /challenge-201/eric-cheung/python | |
| parent | 271b545bdf999895f716e3fdd1294e0f522a047e (diff) | |
| download | perlweeklychallenge-club-ff9c2dc64f984f4e5be20ce7b492f02966cd2439.tar.gz perlweeklychallenge-club-ff9c2dc64f984f4e5be20ce7b492f02966cd2439.tar.bz2 perlweeklychallenge-club-ff9c2dc64f984f4e5be20ce7b492f02966cd2439.zip | |
- Added solutions by Mark Anderson.
- Added solutions by Bob Lied.
- Added solutions by Mariano Spadaccini.
- Added solutions by Peter Campbell Smith.
- Added solutions by Luca Ferrari.
- Added solutions by W. Luis Mochan.
- Added solutions by Carlos Oliveira.
- Added solutions by Dave Jacoby.
- Added solutions by E. Choroba.
- Added solutions by David Ferrone.
- Added solutions by Roger Bell_West.
- Added solutions by Simon Green.
- Added solutions by Thomas Kohler.
- Added solutions by Arpad Toth.
- Added solutions by Robbie Hatley.
- Added solutions by Jorg Sommrey.
- Added solutions by PokGoPun.
- Added solutions by Pip Stuart.
- Added solutions by Ali Moradi.
- Added solutions by Robert Ransbottom.
- Added solutions by Ulrich Rieke.
- Added solutions by Robert DiCicco.
- Added solutions by Cheok-Yin Fung.
Diffstat (limited to 'challenge-201/eric-cheung/python')
| -rwxr-xr-x | challenge-201/eric-cheung/python/ch-1.py | 8 | ||||
| -rwxr-xr-x | challenge-201/eric-cheung/python/ch-2.py | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/challenge-201/eric-cheung/python/ch-1.py b/challenge-201/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..da9bdec3ed --- /dev/null +++ b/challenge-201/eric-cheung/python/ch-1.py @@ -0,0 +1,8 @@ +
+## nInputArr = [0, 1, 3] ## Example 1
+nInputArr = [0, 1] ## Example 2
+
+nFullArr = range(0, len(nInputArr) + 1)
+nComplementArr = [nElemLoop for nElemLoop in nFullArr if nElemLoop not in nInputArr]
+
+print (nComplementArr)
diff --git a/challenge-201/eric-cheung/python/ch-2.py b/challenge-201/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..8aaeccba36 --- /dev/null +++ b/challenge-201/eric-cheung/python/ch-2.py @@ -0,0 +1,22 @@ +
+## Remarks
+## https://theweeklychallenge.org/blog/perl-weekly-challenge-201/
+## https://www.geeksforgeeks.org/count-ways-reach-nth-stair/
+
+## Python Program to Count Ways to Reach Nth stair
+
+## Recursive Function to Find Nth Fibonacci Number
+def GetFibNum(nInput):
+
+ if nInput <= 1:
+ return nInput
+
+ return GetFibNum(nInput - 1) + GetFibNum(nInput - 2)
+
+
+## Driver Program
+nInputNum = 5
+
+print ("Number of Ways: " + str(GetFibNum(nInputNum + 1)))
+
+## Contributed by Harshit Agrawal
|
