Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- python priority queue
- 알고리즘풀기
- python 알고리즘
- 릿코드풀이
- 파이썬 알고리즘 풀기
- 파이썬 프로그래머스
- leetcode풀기
- 파이썬알고리즘풀기
- leetcode풀이
- 상가수익률계산기
- 릿코드 파이썬
- leetcode 풀기
- 릿코드
- 알고리즘풀이
- 파이썬알고리즘
- python 릿코드
- 파이썬 알고리즘
- 파이썬릿코드풀기
- 코틀린기초
- 파이썬릿코드
- 릿코드풀기
- python sorted
- 잇츠디모
- 파이썬 릿코드
- python zip_longest
- 릿코드 풀기
- binary search
- LeetCode
- python xor
- python Leetcode
Archives
- Today
- Total
목록leetcode destination city (1)
소프트웨어에 대한 모든 것

1436. Destination City 제목 문제) 솔루션1) - hash 자료구조 direct path 두 도시를 key, value 형태의 hash로 저장합니다. destination 중 hash의 key에 없다는 의미는 출발해서 도착하는 도시가 없다는 것이므로 그것이 해에 해당합니다. class Solution: def destCity(self, paths: List[List[str]]) -> str: d = {} for path in paths: d[path[0]] = path[1] for dest in d.values(): if dest not in d: return dest return None 솔루션2) - set 사용 출발하는 도시와 도착하는 도시를 set 자료구조로 데이터를 유지합니다...
알고리즘/LeetCode
2021. 11. 21. 13:07