Given the head of a doubly linked list and an integer val, delete the first node whose value equals val. Correctly update both prev and next pointers. Return the head.
If val is not found, return the list unchanged.
Input: Head of a DLL and integer val.
Output: Head of the updated DLL.
Input: [1,2,3,4,5], 3
Output: [1,2,4,5]
Explanation: Find node(3). node(2).next=node(4); node(4).prev=node(2). Unlinked node(3).Input: [1,2,3], 1
Output: [2,3]
Explanation: Delete head. New head=node(2); node(2).prev=NULL.Input: [1,2,3], 4
Output: [1,2,3]
Explanation: Val 4 not found. Return unchanged.1<=nodes<=10^4-10^9<=Node.val<=10^9