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 | 29 | 30 |
Tags
- BAEKJOON
- cos pro 1급
- Algorithm
- 코드품앗이
- DFS와BFS
- django
- 동적계획법과최단거리역추적
- 개발
- 코테
- cos pro
- 분할정복
- android
- 백준
- 알고리즘
- 안드로이드
- C++
- AndroidStudio
- cos
- issue
- DART
- 안드로이드스튜디오
- docker
- 파이썬
- DFS
- codingtest
- vuejs
- 동적계획법
- Flutter
- Python
- 코딩테스트
Archives
- Today
- Total
목록cos 1급 6차 큰수와 작은수의 차이 python (1)
Development Artist

문제 유형 코딩 난이도 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