본문 바로가기

ror_coding

검색하기
ror_coding
프로필사진 ro_rdil_31

  • Home (160)
    • Data Analysis (13)
      • Growth Hacking (7)
      • Tableau (6)
    • Coding Test (140)
      • Python (86)
      • SQL (54)
    • Certificate (5)
      • 빅데이터 분석 기사 (0)
      • SQLD (3)
      • ADsP (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
  • RoR's Github
«   2025/08   »
일 월 화 수 목 금 토
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
31
Tags
  • 프로그래머스
  • 코딩테스트
  • LeetCode
  • Stack
  • time complexity
  • 코딩
  • sql
  • 완전탐색
  • Level2
  • coding
  • itertools
  • 조합
  • Growth hacking
  • join
  • hackerrank
  • cte
  • 파이썬
  • lv4
  • AARRR
  • tableau
  • counter
  • mysql
  • programmers
  • coding test
  • Queue
  • 코테
  • level4
  • python
  • import re
  • lambda
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록42885 (1)

ror_coding

[Programmers] 구명보트 - 42885

최대 2명 태울 수 있으니 (작은값 + 큰값) 가능하면 넘기고 안 되면 큰 값 혼자 넘긴다.Question 구명보트를 최대한 적게 사용하여 모든 사람을 구출하려고 합니다.사람들의 몸무게를 담은 배열 people과 구명보트의 무게 제한 limit가 매개변수로 주어질 때, 모든 사람을 구출하기 위해 필요한 구명보트 개수의 최솟값을 return 하도록 solution 함수를 작성해주세요.  Code def solution(people, limit): cnt = 0 people = sorted(people,reverse=True) for i in people: total = i if total + people[-1]  now meOn my github

Coding Test/Python 2024. 10. 24. 12:02
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바