๋ฌธ์ ๐ฝ
https://school.programmers.co.kr/learn/courses/30/lessons/42747
๋ค๋ฅธ์ฌ๋ ํ์ด ๐ฝ
function solution(citations) {
citations = citations.sort(sorting);
var i = 0;
while(i + 1 <= citations[i]){
i++;
}
return i;
function sorting(a, b){
return b - a;
}
}
๋ดํ์ด๐ฝ
1. ์ฑ๊ณต โญ
function solution(citations) {
let answer = 0;
for(let i=citations.length; i>=1; --i){
let countCitations = citations.filter((value)=> value>=i).length
if(countCitations>=i){
answer=i;
break;
}
}
return answer;
}
๋๋์ ๐ฝ
๋ฌธ์ ๋ฅผ ๋ค์๋ณด๊ณ ์์ธ์ ๊ฒฝ์ฐ๋ฅผ ๋ค์ ํ์ธํด๋ณด์ ...