알고리즘(숫자 야구)
[숫자 야구] * 로직 1~9까지 숫자 중 3가지 수를 뽑는 모든 경우를 구한다(순열) 숫자가 만들어질 때마다 baseball 질문 개수만큼 비교를 진행한다 만약 질문의 결과와 일치하지 않는다면 false 모두 다 일치한다면 true 모두 다 일치하게되면 답을 카운팅한다 // 숫자야구 public class Problem_NumberBaseball { static boolean[] checked; static int[] arr; static int N; static int R; static int result; public static void main(String[] args) { int[][] baseball = { {123, 1, 1}, {356, 1, 0}, {327, 2, 0}, {489, 0,..
2020. 4. 17.