본문 바로가기

공부하자

검색하기
공부하자
프로필사진 strongstar

  • 분류 전체보기 (28) N
    • WEB (25)
      • React (1)
      • Node.js (8)
      • AWS (3)
      • Spring Boot (9)
      • 기타 (4)
    • Data Engineering (3) N
      • DE7 실습 코드 (1) N
      • Python (2) N
Guestbook
Notice
Recent Posts
Recent Comments
Tags
  • 코테
  • 웹템플릿
  • Spring Boot
  • putty
  • rds
  • ec2
  • 웹개발
  • js
  • aws
  • 개발환경
  • Python
  • nodejs
  • REACT
more
Link
  • GitHub
«   2025/09   »
일 월 화 수 목 금 토
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
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Data Engineering/Python (2)

공부하자

[코테] 프로그래머스 - 가장 큰 수 (Lv.2) Python 풀이

123456789101112131415161718192021from functools import cmp_to_key def solution(numbers): strNums = map(str, numbers) strNums = sorted(strNums, key=cmp_to_key(compare)) return ''.join(strNums) if strNums[0] != '0' else '0' def compare(strNum1, strNum2): num1 = strNum1 + strNum2 num2 = strNum2 + strNum1 if num1 num2: return 1 elif num2 num1: return -1 else:..

Data Engineering/Python 2025. 9. 18. 20:34
[코테] 프로그래머스 - 더 맵게 (Lv.2) Python 풀이

1234567891011121314151617181920212223import heapq def solution(scoville, K): answer = 0 heapq.heapify(scoville) while True: min1 = heapq.heappop(scoville) if min1 >= K: break elif len(scoville) == 0: answer = -1 break min2 = heapq.heappop(scoville) new_scoville = min1 + 2*min2 heapq.heappush(scoville, new..

Data Engineering/Python 2025. 9. 18. 20:29
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바