From b91a4623cd4c2b51f779f59b53310a0bd745f03f Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 18 Mar 2024 17:15:14 +0000 Subject: - Added solutions by Eric Cheung. - Added solutions by Ulrich Rieke. - Added solutions by Andrew Shitov. - Added solutions by Peter Meszaros. - Added solutions by Feng Chang. - Added solutions by Mark Anderson. - Added solutions by Peter Campbell Smith. - Added solutions by E. Choroba. - Added solutions by W. Luis Mochan. - Added solutions by David Ferrone. --- challenge-261/eric-cheung/python/ch-2.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 challenge-261/eric-cheung/python/ch-2.py (limited to 'challenge-261/eric-cheung/python/ch-2.py') 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) -- cgit