일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python Implementation
- Convert Sorted List to Binary Search Tree
- Python
- Class
- Protocol
- kaggle
- 43. Multiply Strings
- 315. Count of Smaller Numbers After Self
- Substring with Concatenation of All Words
- 프로그래머스
- shiba
- 밴픽
- Regular Expression
- t1
- Decorator
- 운영체제
- DWG
- 30. Substring with Concatenation of All Words
- Python Code
- Generator
- 컴퓨터의 구조
- 파이썬
- iterator
- LeetCode
- attribute
- data science
- 시바견
- 715. Range Module
- concurrency
- 109. Convert Sorted List to Binary Search Tree
Archives
- Today
- Total
목록Max Points on a Line (1)
Scribbling
LeetCode: 149. Max Points on a Line
직선 찾기 문제 핵심은... 1) 실수 처리를 회피하기 위한 slope의 처리 2) map의 활용 from collections import defaultdict import math class Solution: def maxPoints(self, points: List[List[int]]) -> int: ret = 1 for i in range(len(points)): p1 = points[i] lineDict = defaultdict(lambda: 1) for j in range(len(points)): if i == j: continue p2 = points[j] dx = p2[0] - p1[0] dy = p2[1] - p1[1] if dx == 0: slope = (0, 1) elif dy == ..
Computer Science/Coding Test
2021. 11. 22. 14:16