Maximize Distinct Elements After Swaps

Given two integer arrays a and b, both of length n, and an integer k.

In one operation, choose an index i and an index j, then swap a[i] with b[j]. You may perform at most k swaps. ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: