프로그래머스 2024 KAKAO WINTER INTERNSHIP 도넛과 막대 그래프
package mainimport "fmt"func main() { edges := [][]int{{2, 1}, {2, 5}, {3, 4}, {4, 5}, {5, 6}, {6, 7}, {7, 3}, {3, 8}, {8, 9}, {9, 10}, {10, 11}, {11, 3}} //edges := [][]int{{4, 7}, {1, 12}, {8, 3}, {12, 7}, {4, 2}, {7, 11}, {4, 8}, {9, 6}, {10, 11}, {6, 10}, {3, 5}, {11, 1}, {5, 3}, {11, 9}, {3, 8}} fmt.Println(solution(edges))}func solution(edges [][]int) []int { result := make([]int, 4) edges..
프로그래머스 [PCCP 기출문제] 3번 / 충돌위험 찾기 - golang
func main() { points := [][]int{{2, 2}, {2, 3}, {2, 7}, {6, 6}, {5, 2}} routes := [][]int{{2, 3, 4, 5}, {1, 3, 4, 5}} fmt.Println(solution(points, routes))}func solution(points [][]int, routes [][]int) int { // 충돌 횟수 result := 0 // 경과 시간 cnt := 0 // 각각의 초단위 로봇별 지점 확인 key : [로봇넘버] value : 로봇의 좌표 pointsMap := make(map[int][2]int, 0) // [지나간 포인트의 갯수,지금 가고 있는 방향] currentHeadingRoute := make([][2]int..