일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 사이드
- 개발자
- 운동
- 영어공부
- 링피트
- leetcode
- 월간
- 읽기
- 뭐든
- 만화도
- English
- 쓰릴오브파이트
- 3줄정리
- Daily Challenge
- 파비최
- Writing
- 스탭퍼
- 괜찮음
- 프로젝트
- 영어원서읽기
- 리얼 클래스
- 10분
- 잡생각
- Problem Solving
- 30분
- realclass
- 매일
- 화상영어
- FIT XR
- 미드시청
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/intersection-of-two-linked-lists/
Intersection of Two Linked Lists - 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
오예 Easy 난이도다 ㅎㅎ
근데 문제 설명이랑 풀이가 너무 상이해서.. 혼란이 왔음 ㅋㅋㅋ
class Solution:
def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> Optional[ListNode]:
set_first = set()
curr = headA
while curr:
set_first.add(curr)
curr = curr.next
curr = headB
while curr:
if curr in set_first:
return curr
curr = curr.next
return None
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
Today's Challenge (0) | 2022.06.08 |
---|---|
Today's Challenge (0) | 2022.06.07 |
Today's Challenge (0) | 2022.06.05 |
Today's Challenge (0) | 2022.06.04 |
Today's Challenge (0) | 2022.06.03 |
Comments