[프로그래머스, Java][PCCE 기출문제] 9번 / 지폐 접기
·
CodingTest/Programmers
💡풀이class Solution { public int solution(int[] wallet, int[] bill) { // 지갑의 긴 변과 짧은 변 int width = Math.max(wallet[0], wallet[1]); int height = Math.min(wallet[0], wallet[1]); int answer = 0; // 접는 횟수 while (true) { // 현재 크기로 지갑에 들어가면 종료 if (width >= Math.max(bill[0], bill[1]) && height >= Math.min(bill[0], bill[1])) {..