For this Question: Find the Highest Common divisor (H.C.F) between N and M.<b>User Task</b>
Since this is a functional problem, you don't have to worry about the input. You just have to complete the function <i>HCF()</i> which contains the given number N and P.

<b>Constraints:</b>
1 <= N, P <= 10<sup>5</sup>

<b>Note:</b> 
<i>But there is a catch here given user function has already code in it which may or may not be correct, now you need to figure out these and correct if it is required</i>Return the H.C.F of the given numbers.Sample Input:-
2 4

Sample Output:-
2

Sample Input:-
3 8

Sample Output:-
1, I have written this Solution Code: static int HCF(int N, int P){
int ans=1;
for(int i=2;i<=N;i++){
if(N%i==0 && P%i==0){
ans=i;
}
}
return ans;
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?