[프로그래머스][JAVA] 8주차_최소직사각형 (수학)

[프로그래머스][JAVA] 8주차_최소직사각형 (수학)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

import java.util. * ; class Solution { public int solution( int [][] sizes) { int a = 0 ; int b = 0 ; for ( int [] size : sizes){ int lg = Math.max(size[ 0 ],size[ 1 ]); int sm = Math.min(size[ 0 ],size[ 1 ]); a = Math.max(a,lg); b = Math.max(b,sm); } return a * b; } } Colored by Color Scripter

from http://aig2029.tistory.com/354 by ccl(A) rewrite - 2021-10-29 11:27:40