[프로그래머스] 숫자 변환하기 - Java
·
PS/프로그래머스
import java.util.*;class Solution { public int solution(int x, int y, int n) { int answer = 0; Queue q = new LinkedList(); q.add(new int[]{x, 0}); boolean[] visited = new boolean[y - x + 1]; while(!q.isEmpty()){ int[] curr = q.poll(); if(curr[0] == y){ return curr[1]; } ..