Imperative VS Declarative Programming Part 2
class Test { public static void main(String[] args) { List<Integer> integers = new ArrayList<>(Arrays.asList(1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 9, 9, 10)); List<Integer> resultList = new ArrayList<>(); for (Integer integer : integers) { if (!resultList.contains(integer)) { resultList.add(integer); } } System.out.println(resultList); } } Output: [1, 2, 3, 4, 5, 6, 7, 8,…
Read More Imperative VS Declarative Programming Part 2