Hi, There!
안녕하세요, 바오밥입니다.
목차
- 문제
- 풀이
문제
문제 내용
https://school.programmers.co.kr/learn/courses/30/lessons/120882
풀이
나의 풀이
class Solution {
public int[] solution(int[][] score) {
int len = score.length;
int[] answer = new int[len];
int[] sums = new int[len];
for(int i=0; i<len; i++)
sums[i] = score[i][0]+score[i][1];
for(int i=0; i<len; i++) {
answer[i] = 1;
for(int j=0; j<len; j++) {
if(sums[i] < sums[j]) answer[i]++;
}
}
return answer;
}
}
'Dev > PS' 카테고리의 다른 글
[프로그래머스-코딩테스트 입문] 로그인 성공? (0) | 2023.08.30 |
---|---|
[프로그래머스-코딩테스트 입문] 옹알이 (1) (0) | 2023.08.30 |
[프로그래머스-코딩테스트 입문] 특이한 정렬 (0) | 2023.08.30 |
[프로그래머스-코딩테스트 입문] 유한소수 판별하기 (0) | 2023.08.30 |
[프로그래머스-코딩테스트 입문] 겹치는 선분의 길이 (0) | 2023.08.30 |