plduhoux
2/24/2018 - 12:40 AM

onlyEvenNumbers

List<Integer> onlyEvenNumbers(int left, int right) {
    List<Integer> res = new ArrayList<>();
    for (int i = left; i <= right; i++) {
        if (i % 2 == 0) res.add(i);
    }
    return res;
}