From d3cd6c8a7072e6f3566176284074c04501bfe8e3 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Tue, 2 Jul 2024 13:19:01 +0100 Subject: - Added solutions by Eric Cheung. - Added solutions by Ulrich Rieke. - Added solutions by Roger Bell_West. - Added solutions by Robbie Hatley. - Added solutions by Simon Green. - Added solutions by Thomas Kohler. - Added solutions by Steven Wilson. - Added solutions by Mark Anderson. - Added solutions by PokGoPun. - Added solutions by W. Luis Mochan. - Added solutions by David Ferrone. - Added solutions by Peter Campbell Smith. - Added solutions by E. Choroba. - Added solutions by Ryan Thompson. - Added solutions by Matthew Neleigh. - Added solutions by Dave Jacoby. - Added solutions by Feng Chang. - Added solutions by Joelle Maslak. - Added solutions by Niels van Dijke. - Added solutions by Mariano Ortega. --- challenge-276/eric-cheung/python/ch-2.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 challenge-276/eric-cheung/python/ch-2.py (limited to 'challenge-276/eric-cheung/python/ch-2.py') diff --git a/challenge-276/eric-cheung/python/ch-2.py b/challenge-276/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..1f41b77181 --- /dev/null +++ b/challenge-276/eric-cheung/python/ch-2.py @@ -0,0 +1,9 @@ + +## arrInt = [1, 2, 2, 4, 1, 5] ## Example 1 +arrInt = [1, 2, 3, 4, 5] ## Example 2 + +arrFreq = [arrInt.count(nLoop) for nLoop in set(arrInt)] + +nMaxFreq = max(arrFreq) + +print (nMaxFreq * arrFreq.count(nMaxFreq)) -- cgit