로딩
요청 처리 중입니다...

JAVA_프로그래머스_PCCE 기출문제9번_지폐 접기

 JAVA_프로그래머스_PCCE 기출문제9번_지폐 접기

JAVA_프로그래머스_PCCE 기출문제9번_지폐 접기 풀이 class Solution { public int solution(int[] wallet, int[] bill) { // 먼저 각 영역별 최대, 최소값을 구하고 조건에 부합할때까지 계속해서 나눈다. int answer = 0; int billMin = Math.min(bill[0], bill[1]), billMax = Math.max(bill[0], bill[1]); int walletMin = Math.min(wallet[0], wallet[1]), walletMax = Math.max(wallet[0], wallet[1]); while(true){ // 90도 돌려서 넣을 수 있는 조건 검사 boolean fitsNormal = (billMin <= walletMin && billMax <= walletMax); boolean fitsRotated = (billMin <= walletMax && billMax <= wal...