For this Question: Given two arrays of size N which have the same values but in different orders, we need to make a second array the same as a first array using a minimum number of swaps.

Note:- It is guaranteed that the elements of the array are uniqueFirst line of input contains the size of array N, second line of input contains N space separated integers depicting values of first array, third line of input contains N space separated integers depicting values of second array.

Constraints:-
1 < = N < = 10000
1 < = Arr[i] < = 1000000000Print the minimum number of swaps required to make the second array equal to first.Sample Input:-
5
1 2 3 4 5
3 1 2 5 4

Sample Output:-
3

Sample Input:-
4
3 6 4 8
4 6 8 3

Sample Output:-
2, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String s[] = br.readLine().split(" ");
        int a[] = new int[n];
        int b[] = new int[n];
        for(int i=0;i<n;i++)
            a[i] = Integer.parseInt(s[i]);
        String s1[] = br.readLine().split(" ");
        for(int i=0;i<n;i++)
            b[i] = Integer.parseInt(s1[i]);
        int t = miniSwap(a,b,n);
        System.out.print(t);
    }
    public static int miniSwap(int []a, int b[], int n){
        int count=0;
        for(int i=0;i<n;i++){
            if(a[i]!=b[i]){
                count++;
                for(int j=i+1;j<n;j++){
                    if(a[i]==b[j])
                        swap(i,j,b);
                }
            }
        }
        return count;
    }
    public static void swap(int i,int j,int []b){
        int temp = b[i];
        b[i] = b[j];
        b[j] = temp;
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?