Given the head of a singly linked list and an integer val, delete the first occurrence of a node with value val from the list and return the head.
If the value does not exist, return the list unchanged.
Input: Head of a singly linked list and an integer val.
Output: Head of the updated linked list.
Input: [1,2,3,4,5], 3
Output: [1,2,4,5]
Explanation: Find node(3). Its previous node(2) points to node(4). Node(3) is unlinked.Input: [1,2,3], 1
Output: [2,3]
Explanation: Delete the head node. Return node(2) as new head.Input: [1,2,3], 4
Output: [1,2,3]
Explanation: Value 4 not found. Return list unchanged.1 <= number of nodes <= 10^5-10^9 <= Node.val <= 10^9-10^9 <= val <= 10^9