You are given an array A of size N. In one operation, you can select a subsequence of A such that no two elements are the same in the selected subsequence and delete the selected elements from the array A.
Find the minimum number of operations required to delete all the elements.
1 <= N <= 105
1 <= A[i] <= 109
A : [ 3, 1, 3 ]Input 2:
A : [1, 1]
First, we can select [3, 1] and delete them. The array becomes . We can do one more operation to delete it.Explanation 2:
We can do 2 operations to delete both the elements.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.