[JS] 프로그래머스 0단계: 정답률 57% - 다음에 올 숫자

ahyes·2022년 12월 13일
0
post-thumbnail

안녕하세요.
오늘은 정답률 57%문제를 풀어보겠습니다.

function solution(common) {
    var answer = 0;
    common[1]*2-common[0] === common[2]?answer=common[0]+(common[1]-common[0])*common.length:answer= common[0]*((common[1]/common[0])**common.length);
    return answer;
}
profile
티스토리로 이사갑니다. https://useyhnha.tistory.com/

0개의 댓글