프로그래머스 Lv.0 등차수열의 특정한 항만 더하기개발자가 되기까지 (2023.08.16~2024.04.15)/[Algorithm] Programmers ver.Java2024. 1. 23. 10:14
Table of Contents
<Solution>
class Solution {
public int solution(int a, int d, boolean[] included) {
int answer = 0;
for(int i = 0; i < included.length; i++) {
if(included[i]) {
answer += a;
}
a += d;
}
return answer;
}
}
728x90
@rlozlr :: 얼렁뚱땅 개발자
얼렁뚱땅 주니어 개발자
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!