코테 74

[프로그래머스] 숫자 변환하기 (Java)

문제설명dp 사용배열 전체 최댓값으로 초기화각 배열의 값에 x로 부터 현재 값이 만들어지는 연산의 최솟값을 갱신해 저장이때, if(arr[i] == Integer.MAX_VALUE) continue; 를 넣지 않자 1, 8, 11, 12, 14, 15, 16번 테케가 틀렸다찾아보니 예외처리를 하지 않으면 Integer.MAX_VALUE이 오버플로우가 발생해 값이 달라지는 것 같다고한다[참고] https://stritegdc.tistory.com/324제출 코드import java.util.*;class Solution { public int solution(int x, int y, int n) { int answer = 0; int[] arr = new int[y+1]; ..