Approach for this question

This question was asked in Scalar Discovery challenge which is over now. The question is-

Given two arrays A and B of size N. We are allowed to shuffle the array A, such that the sum of “A[i] xor B[i]” is minimized. Output the minimised sum.
Example-
3
1 0 3
5 3 4
Ans- 8

Constraints-
1<=N<=16
0<=A[i],B[i]<=10^8
What should be the approach for this?

what are constraints?

Updated the question

dp with mask will be enough to solve this problem
16 * pow(2, 16)
look at this problem, same problem i guess
two successful submission