![프로그래머스 Lv.0 등차수열의 특정한 항만 더하기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb5rYaS%2FbtsDKI8yMdH%2FhE6OLA4yH1vjYnw6s5WhcK%2Fimg.png)
프로그래머스 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;
}
}
반응형
@rlozlr :: 얼렁뚱땅 개발자
얼렁뚱땅 주니어 개발자
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!