{"id":20634,"date":"2021-09-21T08:59:11","date_gmt":"2021-09-21T03:29:11","guid":{"rendered":"https:\/\/python-programs.com\/?p=20634"},"modified":"2021-11-22T18:36:18","modified_gmt":"2021-11-22T13:06:18","slug":"python-program-to-find-the-sum-of-all-highest-occurring-elements-in-an-array-list","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-find-the-sum-of-all-highest-occurring-elements-in-an-array-list\/","title":{"rendered":"Python Program to Find the sum of all Highest Occurring Elements in an Array\/List"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find the Sum of all Odd Frequency Elements in an Array\/List<\/a><\/p>\n

Given a list, the task is to find the sum of the maximum frequency elements of a given list.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List = [4, 5, 5, 2, 4, 2, 2, 3, 3, 4, 9, 8, 5, 1, 1]<\/pre>\n

Output:<\/strong><\/p>\n

The sum of elements in the given list [4, 5, 5, 2, 4, 2, 2, 3, 3, 4, 9, 8, 5, 1, 1] which are having maximum frequency are :\r\n11<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given List = [10, 20, 30, 40, 20, 25]<\/pre>\n

Output:<\/strong><\/p>\n

The sum of elements in the given list [10, 20, 30, 40, 20, 25] which are having maximum frequency are :\r\n20<\/pre>\n

Program to Find the sum of all Highest Occurring Elements in an Array\/List in Python<\/h2>\n

Below are the ways to find the sum of the maximum frequency elements of a given list in python:<\/p>\n