public static Node deletion(Node head , int pos) {
    if(pos==1) {
        deleteAtHead(head);
        return head;
    }
    
    Node temp=head;
    int count=1;
    while(temp!=null && count!=pos) {
        temp=temp.next;
        count++;
    }
    temp.prev.next=temp.next;
    if(temp.next!=null) {
    temp.next.prev=temp.prev;
    }
    return head;
//      temp=null;
}
this is my code here and i'm not sure whats the problem here
