From c5ca130343e62834e6079e43b5cb9588ce0243b1 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Tue, 22 Jul 2025 00:44:04 +0100 Subject: - Added solutions by Eric Cheung. - Added solutions by Ulrich Rieke. - Added solutions by Lukas Mai. - Added solutions by Andrew Shitov. - Added solutions by Feng Chang. - Added solutions by Alexander Karelas. - Added solutions by Simon Proctor. - Added solutions by E. Choroba. - Added solutions by Andreas Mahnke. - Added solutions by Kjetil Skotheim. - Added solutions by PokGoPun. - Added solutions by W. Luis Mochan. - Added solutions by Mark Anderson. - Added solutions by David Ferrone. - Added solutions by Peter Meszaros. - Added solutions by Thomas Kohler. - Added solutions by Peter Campbell Smith. --- challenge-331/eric-cheung/python/ch-1.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 challenge-331/eric-cheung/python/ch-1.py (limited to 'challenge-331/eric-cheung/python/ch-1.py') diff --git a/challenge-331/eric-cheung/python/ch-1.py b/challenge-331/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..a7d0dcd351 --- /dev/null +++ b/challenge-331/eric-cheung/python/ch-1.py @@ -0,0 +1,12 @@ + +import re + +## strInput = "The Weekly Challenge" ## Example 1 +## strInput = " Hello World " ## Example 2 +strInput = "Let's begin the fun" ## Example 3 + +strOutput = re.sub(r"\s+", " ", strInput).strip() + +arrOutput = [strLoop for strLoop in strOutput.split(" ") if strLoop] + +print (len(arrOutput[-1])) -- cgit