Skip to content

Commit

Permalink
최댓값 만들기(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Mar 27, 2023
1 parent 5a92377 commit f3242db
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Programmers/exam48.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function solution(numbers) {
numbers.sort((a, b) => a - b);
return Math.max(
numbers[0] * numbers[1],
numbers[numbers.length - 2] * numbers[numbers.length - 1]
);
}

0 comments on commit f3242db

Please sign in to comment.