분류 전체보기 151

[programmers] 달리기 경주

https://school.programmers.co.kr/learn/courses/30/lessons/178871 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr calling이 최대 1,000,000 이기 때문에 calling 단독 for문이 돌고 그 안에서 문제를 해결해야한다. swap 코드 대신 ArrayList의 set을 사용한 코드 import java.util.*; class Solution { public String[] solution(String[] players, String[] callings) { String[] answer = {}..

코딩테스트 2024.04.13

[programmers] 게임 맵 최단거리

https://school.programmers.co.kr/learn/courses/30/lessons/1844 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr dfs로 푼 풀이 바로 떠올라서 풀었던 부분 import java.util.*; class Solution { static int n, m; static int[][] routes; static int[][] maps1; public int solution(int[][] maps) { int answer = 0; n = maps.length; m = maps[0].length; routes = ne..

코딩테스트 2024.03.31

[programmers][PCCE] 9. 이웃한 칸

https://school.programmers.co.kr/learn/courses/30/lessons/250125 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1. 내멋대로 풀기 굳이..4방향만 확인하는데 문제에 나온 것처럼 배열만들고 해야하나 싶어서 아래와 같이 확인 class Solution { public int solution(String[][] board, int h, int w) { int answer = 0; String color = board[h][w]; if (h - 1 > -1 && color.equals(board[h - 1][w..

코딩테스트 2024.03.24