YJ의 새벽
프로그래머스(0) - 카운트 업 [JAVA] 본문
class Solution {
public int[] solution(int start_num, int end_num) {
int[] answer = new int[(end_num-start_num)+1];
int a = 0;
for(int i=start_num; i<=end_num; i++) {
answer[a] = i;
a++;
}
return answer;
}
}
'코딩테스트연습 > 프로그래머스' 카테고리의 다른 글
프로그래머스(0) - 순서 바꾸기 [JAVA] (0) | 2024.03.15 |
---|---|
프로그래머스(0) - n 번째 원소부터 [JAVA] (0) | 2024.03.15 |
프로그래머스(0) - 7의 개수 [JAVA] (0) | 2024.03.13 |
프로그래머스(0) - k의 개수 [JAVA] (0) | 2024.03.13 |
프로그래머스(0) - A로 B만들기 [JAVA] (0) | 2024.03.13 |
Comments