Skip to content

Commit

Permalink
직사각형 넓이 구하기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed May 27, 2023
1 parent 28cefea commit b971485
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Programmers/exam81.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function solution(dots) {
dots.sort();
const x = Math.abs(dots[0][0] - dots[2][0]);
const y = Math.abs(dots[0][1] - dots[1][1]);
return x * y;
}

0 comments on commit b971485

Please sign in to comment.