원본 : https://school.programmers.co.kr/learn/courses/30/lessons/133501
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
풀이
import java.util.Arrays;
class Solution {
public int solution(int distance, int[][] scope, int[][] times) {
for (int i = 0; i < scope.length; i++) {
Arrays.sort(scope[i]);
for (int j = scope[i][0]; j <= scope[i][1]; j++) {
if (j % (times[i][0] + times[i][1]) > 0 && j % (times[i][0] + times[i][1]) <= times[i][0]) {
distance = Math.min(j, distance);
break;
}
}
}
return distance;
}
}
푸드 파이트 대회 (연습문제) (0) | 2022.11.13 |
---|---|
과일 장수 (연습문제) (0) | 2022.11.13 |
옹알이 (2) (연습문제) (0) | 2022.10.29 |
햄버거 만들기 (연습문제) (0) | 2022.10.29 |
할인 행사 (연습문제) (0) | 2022.10.23 |
댓글 영역