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
- Oracle
- 청크
- 121
- overriding
- null
- react
- 오버라이딩
- JIT
- 개발기록
- 리스트 자르기
- 쓰는이유
- defaultdict
- GCP Storage
- java
- DAO의 분리
- 데이터베이스
- 싱글톤
- ChainMap
- Spring Framework
- spring
- 싱글톤 레지스트리
- 자바
- select
- 스프링
- 외부조인
- DAO
- 백준
- orderedDict
- 파이썬
Archives
- Today
- Total
목록121 (1)
PengTory
[LeetCode] 121번 (Python)
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ 1번 시도 -> 잘 돌아가는가 했으나 Time Limit Exceeded 2중 for문을 사용해 브루트포스 방법으로 모든 경우의 수를 돌려보려 했으나 시간복잡도가 O(n^2)여서 Time Limit에 걸린 것 같음 이중 for문을 사용하지 않는 방식을 고려해보자 class Solution: def maxProfit(self, prices: List[int]) -> int: # small이 무조건 가장 작은 값이 아님 -> 계산을 한 값을 넣어야 할 것 같음 small = prices[0] profit = [] minIndex = 0 for i in range(len(prices)): if pr..
Algorithm + 코테준비
2022. 10. 20. 14:26