Recent Posts
Recent Comments
목록1 (1)
밍쎄의 코딩공간
프로그래머스 LV.1 - 공원산책
그래프 탐색 문제이다. 푸는 과정 속에 어려움을 겪어 밑에 분의 코드를 참고하였다. // 2차원 배열을 벗어나지 않으면서 X가 아니면 재귀 호출 이 부분을 구현하는 것이 매우 미흡하였다. import java.util.*; class Solution { static int startX; static int startY; public int[] solution(String[] park, String[] routes) { int[] answer = new int[2]; // 동서남북 이동할 좌표 map에 삽입 Map map = new HashMap(); map.put("N", new int[]{-1, 0}); map.put("E", new int[]{0, 1}); map.put("S", new int[]{1..
프로그래머스/프로그래머스 LV.1
2023. 8. 23. 02:15