본문 바로가기
Algorithm/Programmers

[Programmers] Lv.0 / PCCE / 6번 / 가채점 / Java

by unknownomad 2024. 6. 18.

문제

 

풀이

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;
    }
}

 

출처

https://school.programmers.co.kr/learn/courses/30/lessons/250128

댓글