본문 바로가기

java34

Java 미로찾기 final static int[] xArray = {1, 0, -1, 0}; final static int[] yArray = {0, 1, 0, -1}; public static class Node { int x; int y; public Node(int x, int y) { this.x = x; this.y = y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } public int getX() { return this.x; } public int getY() { return this.y; } } public static void main(String[] args) { maze(); } private st.. 2021. 12. 17.
Java floodfill2 final static int[] xArray = {1, 0, -1, 0}; final static int[] yArray = {0, 1, 0, -1}; public static class Node { int x; int y; public Node(int x, int y) { this.x = x; this.y = y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } public int getX() { return this.x; } public int getY() { return this.y; } } public static void main(String[] args) { floodFill(); } priva.. 2021. 12. 16.
Java floodfill final static int[] xArray = {1, 0, -1, 0}; final static int[] yArray = {0, 1, 0, -1}; public static class Node { int x; int y; public Node(int x, int y) { this.x = x; this.y = y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } public int getX() { return this.x; } public int getY() { return this.y; } } public static void main(String[] args) { floodFill(); } priva.. 2021. 12. 15.
자바 프로그래머스 위클리 챌린지 8주차 최소직사각형 구하기. https://programmers.co.kr/learn/courses/30/lessons/86491 코딩테스트 연습 - 8주차 [[10, 7], [12, 3], [8, 15], [14, 7], [5, 15]] 120 [[14, 4], [19, 6], [6, 16], [18, 7], [7, 11]] 133 programmers.co.kr public int solution(int[][] sizes) { int maxWidth = 0; int maxHeight = 0; int width; int height; final int widthIndex = 0; final int heightIndex = 1; for(int[] size : sizes) { width = size[widthIn.. 2021. 10. 1.