For this Question: Given an integer N, your task is to count the minimum number of operations required to make N a perfect square. In each operation you can either subtract from or add to N by 2. i.e you can wither replace N by N + 2 or by N - 2.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>PerfectSquare()</b> that takes the integer N as parameter.

<b>Constraints:</b>
3 <= N <= 100000

<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 minimum count of operations required.Sample Input:-
15

Sample Output:-
3

Explanation:-
15 - > 13 - > 11 - > 9

Sample Input:-
7

Sample Output:-
1, I have written this Solution Code: 
int PerfectSquare(int N){
    int x=sqrt(N);
    if(x*x==N){return 0;}
if(N%2==0){
    if(x%2==0){return (N-x*x)/2;}
    else{
        return min((N-(x-1)*(x-1))/2,((x+1)*(x+1)-N)/2);
    }
}
else{
    if(x%2==0){

        return min((N-(x-1)*(x-1))/2,((x+1)*(x+1)-N)/2);
    }
    else{
       return (N-x*x)/2;
    }
}

}

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