(C++) - 프로그래머스(찾아라 프로그래밍 마에스터) : 게임 맵 최단거리
programmers.co.kr/learn/courses/30/lessons/1844 코딩테스트 연습 - 게임 맵 최단거리 [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,1],[0,0,0,0,1]] 11 [[1,0,1,1,1],[1,0,1,0,1],[1,0,1,1,1],[1,1,1,0,0],[0,0,0,0,1]] -1 programmers.co.kr bfs문제였습니다. 풀이방법 1. bfs 수행 : d배열을 선언해서 0,0에서 출발하여 벽이 아닌 부분을 이동하며 거리를 저장합니다. 2. 도착했을 때 해당 부분의 값이 0이라면 갈수 없으므로 -1을 반환합니다. 아니라면 d[n-1][m-2]를 반환합니다. Code #include using namespace std; us..
(C++) - 프로그래머스(Summer/Winter Coding(~2018)) : 영어 끝말잇기
programmers.co.kr/learn/courses/30/lessons/12981 코딩테스트 연습 - 영어 끝말잇기 3 ["tank", "kick", "know", "wheel", "land", "dream", "mother", "robot", "tank"] [3,3] 5 ["hello", "observe", "effect", "take", "either", "recognize", "encourage", "ensure", "establish", "hang", "gather", "refer", "reference", "estimate", "executive"] [0,0] programmers.co.kr 구현문제였습니다. 풀이방법 1. 이전 단어의 끝 알파벳이 현재 단어의 처음 알파벳과 다르거나 map..