Examples:

Input: arr [] = {1, 2, 3, 4} Output: 1 Explanation: A single subset can contains all values and all values are distinct Input: arr [] = {1, 2, 3, 3} Output: 2 Explanation: We need to create two subsets {1, 2, 3} and {3} [or {1, 3} and {2, 3}] such that both subsets have distinct elements.

We have a solution for this problem, please refer to subsets-distinct-elements/> Minimum Subsets with Separate link to subsets-distinct-elements/> elements . We’ll quickly fix this problem in python using the subset to be different, and we have to put any repeating element in another subset, so in order to get the minimum number of subsets, we must have at least ** Maximum frequency of subsets **.

` ` |

Output:

2