class Solution {
public int[] solution(int start, int end) {
int[] answer = {};
return answer;
}
}
import java.util.*;
class Solution {
public List solution(int start, int end) {
List<Integer> answer = new ArrayList<>();
for (int i = start; i <= end;i++) {
answer.add(i);
}
return answer;
}
}
ArrayList
class Solution {
public int[] solution(int start, int end) {
int[] answer = new int[end - start + 1];
for (int i = 0; i < answer.length; i++) {
answer[i] = start;
start++;
}
return answer;
}
}