Linked List Delete Last Occurrence of Value
Given a singly linked list node
, and an integer target
, delete the last occurrence of target
in node
.
Constraints
0 ≤ n ≤ 100,000
wheren
is the number of nodes innode
https://binarysearch.com/problems/Linked-List-Delete-Last-Occurrence-of-Value
Examples
Example 1
Input
- node =
- target =
1
Output
- answer =
Example 2
Input
- node =
- target =
3
Output
- answer =
Leave a comment