diff options
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
|
