일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Python Implementation
- 30. Substring with Concatenation of All Words
- Protocol
- 프로그래머스
- 컴퓨터의 구조
- Class
- Generator
- kaggle
- 밴픽
- concurrency
- 715. Range Module
- 시바견
- Python Code
- LeetCode
- 315. Count of Smaller Numbers After Self
- Decorator
- Substring with Concatenation of All Words
- DWG
- attribute
- data science
- iterator
- shiba
- 109. Convert Sorted List to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- 운영체제
- 43. Multiply Strings
- 파이썬
- Python
- Regular Expression
- t1
Archives
- Today
- Total
목록N으로 표현 (1)
Scribbling
프로그래머스: N으로 표현
난이도가 높지는 않은 문제. N을 1개씩 늘려가면서 완전탐색하되, number가 있는지 확인한다. 예컨대... 5가 네개인 경우를 완전탐색하려면, (5, 5, 5, 5) (5) + (5, 5, 5) (5, 5) + (5, 5) (5, 5, 5) + (5) 위의 모든 케이스를 다 따져 주면 된다. 여기서 +는 더하라는 의미가 아니라, 왼쪽에서 발생되는 모든 케이스와 오른쪽에서 발생되는 모든 케이스를 조합하는 모든 케이스를 생성하라는 의미이다. def solution(N, number): if number == N: return 1 dp = [[] for _ in range(9)] dp[1] = [N] for i in range(2, 9): dp[i].append(int(str(N)*i)) for j in ..
Computer Science/Coding Test
2021. 10. 25. 20:55