문제 설명
정수 배열 numbers가 매개변수로 주어집니다. numbers의 원소 중 두 개를 곱해 만들 수 있는 최댓값을 return하도록 solution 함수를 완성해주세요.
입출력 예
numbers | result |
[1, 2, 3, 4, 5] | 20 |
[0, 31, 24, 10, 1, 9] | 744 |
제출 내역
def solution(numbers):
numbers.sort()
return numbers[-1] * numbers[-2]
프로그래머스 코딩테스트 입문 Day11 수학, 반복문
https://school.programmers.co.kr/learn/courses/30/lessons/120847
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
'programmers > 입문' 카테고리의 다른 글
[python] 모음 제거 (1) | 2024.11.26 |
---|---|
[python] 팩토리얼 (0) | 2024.11.25 |
[python] 합성수 찾기 (0) | 2024.11.22 |
[python] 주사위의 개수 (1) | 2024.11.20 |
[python] 배열 회전시키기 (2) | 2024.11.19 |