일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- shiba
- 프로그래머스
- attribute
- 315. Count of Smaller Numbers After Self
- concurrency
- Python Code
- Convert Sorted List to Binary Search Tree
- Python Implementation
- LeetCode
- Decorator
- 파이썬
- Protocol
- data science
- Generator
- Substring with Concatenation of All Words
- Python
- DWG
- 밴픽
- Regular Expression
- 43. Multiply Strings
- 30. Substring with Concatenation of All Words
- 715. Range Module
- 109. Convert Sorted List to Binary Search Tree
- kaggle
- Class
- 시바견
- iterator
- t1
- 운영체제
- 컴퓨터의 구조
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