For this Question: There is an array having unique elements is given as input. Find the index of an element k if present in the array, else -1.There is an integer n is given(size of array nums).
In second line, n space seperated integers are given.
in third line, an integer k is given.
1 <= n <= 10<sup>5</sup>
0 <= nums[i] <= 10<sup>6</sup>
0 <= i <= n-1Find the index of an element k if present in the array, else -1.Sample Input:
5
1 4 3 2 5
3

Sample Output:
2

Explanation: Index of element 3 is 2. So the answer will be 2., I have written this Solution Code: import java.util.*;

public class Main
{
    
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        ArrayList<Integer> v=new ArrayList<>();
        for(int i=0;i<n;i++){
            int a=sc.nextInt();
            v.add(a);
        }
        int k=sc.nextInt();
        int ans=v.indexOf(k);
        System.out.println(ans);
    }
}

, In this Programming Language: Java, Now tell me if this Code is compilable or not?