일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 Code
- 30. Substring with Concatenation of All Words
- Decorator
- 315. Count of Smaller Numbers After Self
- shiba
- 715. Range Module
- 밴픽
- 시바견
- kaggle
- iterator
- Protocol
- attribute
- Python Implementation
- t1
- Convert Sorted List to Binary Search Tree
- concurrency
- DWG
- Python
- Substring with Concatenation of All Words
- 43. Multiply Strings
- LeetCode
- Regular Expression
- data science
- 프로그래머스
- 운영체제
- Generator
- 109. Convert Sorted List to Binary Search Tree
- 파이썬
- Class
Archives
- Today
- Total
목록주식 가격 (1)
Scribbling
프로그래머스: 주식 가격
근본 없는 문제다. 도저히 지문을 이해할 수 없게 적어놨다. def solution(prices): answer = [i for i in range(len(prices)-1, -1, -1)] stack = [] for i in range(len(prices)): p = prices[i] if not stack or p >= stack[-1][0]: stack.append((p, i)) else: while stack and stack[-1][0] > p: bef_p, bef_i = stack.pop() answer[bef_i] = i - bef_i stack.append((p, i)) return answer
Computer Science/Coding Test
2021. 10. 16. 01:09