일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- counter
- time complexity
- 연습문제
- mysql
- collections
- 프로그래머스
- 완전탐색
- coding test
- 코테
- sql
- Queue
- 시간복잡도
- Level2
- lv4
- level4
- 파이썬
- coding
- import re
- 조합
- itertools
- python
- programmers
- Stack
- 데이터분석
- lambda
- join
- CodingTest
- BFS
- 코딩테스트
- 코딩
- Today
- Total
목록135808번 (1)
ror_coding
[Programmer] 과일 장수 - 135808
도대체 이 한 줄 코드를 짠 사람은.. 천재인가..? 문제는 쉬웠으나 한 줄 코드 이해하기! Question 사과의 최대 점수 k, 한 상자에 들어가는 사과의 수 m, 사과들의 점수 score가 주어졌을 때, 과일 장수가 얻을 수 있는 최대 이익을 return하는 solution 함수를 완성해주세요. Point 한 줄 코드 : Code 1for 문 이용해서 price 구하기 : Code 2 Code 1 : 한 줄 코드 def solution(k, m, score): return sum(sorted(score)[len(score)%m::m])*m Code 2 : my code def solution(k, m, score): price = 0 score = sorted(score,reve..
Algorithm/Python
2024. 10. 12. 11:16