← 返回 akunacapital 的题目列表Maximize Distinct Elements
类型:online_judge
Given two arrays a and b, you can swap elements up to k times to maximize the number of distinct elements in array a. Implement a function to calculate and return the maximum number of distinct elements that can be obtained in a.
Example Input
a = [1, 2, 2, 3]
k = 2
b = [4, 5, 6]
Example Output
4
Example
Input
{'a': [1, 2, 2, 3], 'k': 2, 'b': [4, 5, 6]}