...
Challenge: Deletion by Value
Try to solve the Deletion by Value problem.
Given the head of a singly linked list and a value to be deleted from the linked list, if the value exists in the linked list, delete the value and return TRUE. Otherwise, return FALSE.
head
value
Constraints:
Let n be the number of nodes in the linked list:
n
1≤1 \leq1≤ n ≤500\leq 500≤500
−5000≤-5000 \leq−5000≤ Node.data ≤5000\leq 5000≤5000
Node.
data
Preview Free Lessons