내 답안
class Solution {
public int[] solution(int start, int end) {
int[] answer = new int[start-end+1];
for(int i=0; i<answer.length ; i++){
answer[i] = start--;
}
return answer;
}
}
Java
복사
다른사람 풀이
import java.util.stream.IntStream;
class Solution {
public int[] solution(int start, int end) {
return IntStream.rangeClosed(-start, -end).map(i -> -i).toArray();
}
}
Java
복사