You are given two integer arrays nums and forbidden, each of length n.
In one operation, you can choose any two indices i and j and swap the elements nums[i] and nums[j].
Return the minimum number of swaps needed such that nums[i] \neq forbidden[i] for all indices i where n. If it is impossible to satisfy this condition for all indices, return
Constraints:
n nums.length forbidden.length
nums[i], forbidden[i]
You are given two integer arrays nums and forbidden, each of length n.
In one operation, you can choose any two indices i and j and swap the elements nums[i] and nums[j].
Return the minimum number of swaps needed such that nums[i] \neq forbidden[i] for all indices i where n. If it is impossible to satisfy this condition for all indices, return
Constraints:
n nums.length forbidden.length
nums[i], forbidden[i]