-Code
class Solution {
public String[] solution(int[] numbers, int[] our_score, int[] score_list) {
int num_student = numbers.length;
String[] answer = new String[num_student];
for (int i = 0; i < num_student; i++) {
if (our_score[i] == score_list[numbers[i] - 1]) {
answer[i] = "Same";
}
else {
answer[i] = "Different";
}
}
return answer;
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] [PCCE 기출문제] 7번 / 버스 (0) | 2025.02.22 |
---|---|
[프로그래머스/Java] [PCCE 기출문제] 6번 / 물 부족 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 5번 / 심폐소생술 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 3번 / 수 나누기 (0) | 2025.02.22 |
[프로그래머스/Java] [PCCE 기출문제] 1번 / 출력 (0) | 2025.02.22 |