Approach hintTry it first, then revealHide
Place a dummy node before the head so that removing the first node needs no special case, then unlink the next node for as long as its value equals val.
Place a dummy node before the head so that removing the first node needs no special case, then unlink the next node for as long as its value equals val.