For this Question: You have given a linked list, your task is to delete the middle node of the given linked list. In case there are even nodes there will be two middle nodes you need to delete the second middle node of the even node linked list.

<b>Example:</b>
If the given linked list is 1- >2- >3- >4- >5 then the linked list should be modified to 1- >2- >4- >5.
If the given linked list is 1- >2- >3- >4- >5- >6 then the linked list should be modified to 1- >2- >3- >5- >6.<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>deleteMiddleElement()</b> that takes the head node of the linked list as a parameter.

<b>Constraints:</b>
1 &le; N &le; 1000
1 &le; value &le; 1000Return the head of the modified linked listSample Input 1:
6
1 2 3 4 5 6

Sample Output 1:-
1 2 3 5 6

<b>Explanation</b>
There are even nodes in the given linked list so we delete the second middle node which is 4 in this case. So the output is 1 2 3 5 6., I have written this Solution Code:   public static Node deleteMiddleElement(Node head) {
int cnt=0;
Node temp=head;
while(temp!=null){
cnt++;
temp=temp.next;
}
if(cnt==1){
head.val=-1;
return head;
}
if(cnt==2){
head.next=null;
return head;
}
temp=head;
int I=1;
cnt=cnt/2;
while(I!=cnt){
temp=temp.next;
I++;
    }
temp.next=temp.next.next;
        return head;
    }, In this Programming Language: Java, Now tell me if this Code is compilable or not?