diff options
Diffstat (limited to 'challenge-261/eric-cheung/python/ch-2.py')
| -rwxr-xr-x | challenge-261/eric-cheung/python/ch-2.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-261/eric-cheung/python/ch-2.py b/challenge-261/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..a275000b69 --- /dev/null +++ b/challenge-261/eric-cheung/python/ch-2.py @@ -0,0 +1,18 @@ +
+## Example 1
+## arrInt = [5, 3, 6, 1, 12]
+## nStart = 3
+
+## Example 2
+## arrInt = [1, 2, 4, 3]
+## nStart = 1
+
+## Example 3
+arrInt = [5, 6, 7]
+nStart = 2
+
+nFinal = nStart
+while nFinal in arrInt:
+ nFinal = nFinal * 2
+
+print (nFinal)
|
