2019겨울인턴
-
[2019 카카오 겨울인턴] 인형뽑기 (JAVA)알고리즘 공부/문제 풀이 2020. 5. 6. 19:51
package kakao; public class catchDoll { static int solution(int[][] board, int[] moves) { int answer = 0; int[] baguni=new int[1000]; int top=-1; int col; int row=0; for(int i=0;i0 && baguni[top]==baguni[top-1]){ answer +=2 ; top -= 2; } } return answer; } public static void main(String[] args) { // TODO Auto-generated method stub int[][] board= {{0,0,0,0,0},{0,0,1,0,3},{0,2,5,0,1},{4,2,4,4,2},{..