aboutsummaryrefslogtreecommitdiff
path: root/challenge-276/eric-cheung/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-276/eric-cheung/python/ch-2.py')
-rwxr-xr-xchallenge-276/eric-cheung/python/ch-2.py9
1 files changed, 9 insertions, 0 deletions
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))