Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- django
- vuejs
- cos pro
- codingtest
- BAEKJOON
- 동적계획법과최단거리역추적
- 개발
- 백준
- DFS와BFS
- AndroidStudio
- 파이썬
- Vue
- Flutter
- cos pro 1급
- 코딩테스트
- 코드품앗이
- 동적계획법
- DFS
- 알고리즘
- DART
- 코테
- Algorithm
- 안드로이드스튜디오
- cos
- 안드로이드
- 분할정복
- android
- issue
- Python
- C++
Archives
- Today
- Total
목록cos 큰수와 작은수의 차이 python (1)
Development Artist
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/0LE17/btruAsVePZd/vmo3MfqVfEZsWRNKkv8eW0/img.png)
문제 유형 코딩 난이도 normal Note 1. combination(조합) 으로 해결. 2. for문을 돌면서 min과 max를 구해서 빼고 결과를 answer에 업데이트. Code # -*- coding: utf-8 -*- # UTF-8 encoding when using korean import itertools def solution(arr, K): answer = 10001 list_a = list(itertools.combinations(arr, K)) for nums in list_a: list_nums = list(set(nums)) max_n, min_n = max(list_nums), min(list_nums) rtn = max_n - min_n if rtn < answer: answ..
Algorithm/COS
2022. 2. 28. 17:45