[LeetCode] 203. Remove Linked List Elements, Easy
·
CodingTest/LeetCode
1. 문제단일 연결 리스트와 val가 주어질 때, val와 일치하는 노드를 제거한 리스트를 반환하라.2. 해결/** * Definition for singly-linked list. * class ListNode { * val: number * next: ListNode | null * constructor(val?: number, next?: ListNode | null) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } * } */function removeElements(head: ListNode | null, val: num..