일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Convert Sorted List to Binary Search Tree
- kaggle
- shiba
- Python
- 파이썬
- Regular Expression
- attribute
- data science
- 밴픽
- t1
- iterator
- 프로그래머스
- Decorator
- Python Code
- Class
- concurrency
- 43. Multiply Strings
- LeetCode
- 30. Substring with Concatenation of All Words
- Python Implementation
- Generator
- 시바견
- 315. Count of Smaller Numbers After Self
- 운영체제
- DWG
- Protocol
- 109. Convert Sorted List to Binary Search Tree
- Substring with Concatenation of All Words
- 컴퓨터의 구조
- 715. Range Module
Archives
- Today
- Total
목록방의 개수 (1)
Scribbling
프로그래머스: 방의 개수
난이도가 꽤 높은 그래프 문제이다. 방이 만들어지는 조건을 따져야 한다. * 방이 만들어지는 조건 - 재방문한 점이다. - 타고온 edge는 첫 방문이다. 여기까지는 생각하기 쉬운데, 문제는 아래와 같은 케이스다. 현재 알고리즘은 위의 그림에 대해 방을 1개로 파악한다. 이는 가운데 교차점을 정점으로 생각하지 않기 때문이다. 이 문제를 해결할 방법은 여러가지인데, 가장 간단한 방법은 하나의 화살표에 대해 이동을 2번 반복하는 것이다. def solution(arrows): answer = 0 dx = (0, 1, 1, 1, 0, -1, -1, -1) dy = (-1, -1, 0, 1, 1, 1, 0, -1) vertex = set() vertex.add((0, 0)) edge = set() cur = [..
Computer Science/Coding Test
2021. 11. 8. 20:22