[ 코딩테스트 / Lv.1 ] 없는 숫자 더하기

U U·2021년 10월 8일
0

[문제]


[풀이] - javascript

function solution(numbers) {
    let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
    
    return arr.filter(n => !numbers.includes(n)).reduce((acc, curr) => acc + curr, 0);
}

[결과]

성공

profile
언제까지 할 건데

0개의 댓글

Powered by GraphCDN, the GraphQL CDN