Loading...
Loading...
Loading...
A list of coupon codes contains some codes that have expired. Remove every node holding the target value and print what remains, or EMPTY if nothing is left.
Example 1
Input
3 1 3 3 2 3
Output
1 2
Example 2
Input
5 5 5
Output
EMPTY
Try the problem first. Open one hint at a time.
Use a dummy node and look at node.next.
Move node forward only when nothing was removed.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor