Notice
Recent Posts
Recent Comments
Link
코딩 공부
코딩 인터뷰 퀘스천 완전 분석 - Remove Linked List Elements 본문
[LeetCode] [Easy] 203. Remove Linked List Elements
leetcode.com/problems/remove-linked-list-elements/
Remove Linked List Elements - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
연결된 리스트 특정 노드 삭제하기
이렇게 연결되어있을때 주어진 값을 가진 노드를 지우고 맨 앞에 노드를 리턴하면 됩니다. 저는 앞쪽 노드를 저장해두면서 같은 숫자가 나올때 현재 노드를 스킵하는 방법으로 코드를 작성했습니다.
살짝 아쉬운 결과네요..
그전 노드를 저장해두지 않아서 더 빠르게 나올수 있는것 같네요. 항상 최적화를 생각하는 습관을 들여야 겠어요.
'Coding' 카테고리의 다른 글
코딩 인터뷰 퀘스천 완전 분석 - Ransome Note (0) | 2020.11.08 |
---|---|
코딩 인터뷰 퀘스천 완전 분석 - Valid Anagram (0) | 2020.10.27 |
코딩 인터뷰 퀘스천 완전 분석 - Isomorphic Strings (0) | 2020.10.26 |
코딩 인터뷰 퀘스천 완전 분석 - Reformat The String (0) | 2020.10.24 |
코딩 인터뷰 퀘스천 완전 분석 - Binary Number with Alternating Bits (0) | 2020.10.23 |
Comments