One-line Solution, beats 95%
Intuition\n Describe your first thoughts on how to solve this problem. \n> It is a solution of my friend Ruslans (@ruslans_al), which was refined by me slightly
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n> It is a solution of my friend Ruslans (@ruslans_al), which was refined by me slightly.\n\nLet\'s consider subsets of array `nums`: $$A_1,...,A_k$$, each of them does not contain repeating integers. For each $$A_j$$ answer is a $$|A_j|-1$$. Therefore, the answer for the overall array `nums` is a $$\\sum\\limits_j (|A_j|-1)=n-k$$, where $$n$$ is the length of `nums` and $$k$$ is the number of subsets $A_j$ in `nums`. On the other hand, $$k$$ is equal to the number of occurrences of the most frequent integer in the array `nums`.\n\n\n \n---\n# Approach\n<!-- Describe your approach to solving the problem. -->\nSee the one-line code snippet below.\n---\n---\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n---\n# Code\n```python []\nclass Solution:\n    def maximizeGreatness(self, nums: List[int]) -> int:\n        return len(nums) - max(Counter(nums).values())  \n```\n---\n```\nIf you like this solution, upvote please\n```
['Math', 'Python3']