Skip to content

Commit f9efd38

Browse files
authored
Fix: Replaced removeLast() with remove(current.size() - 1) (#6152)
Fix: Replaced removeLast() with remove(current.size() - 1) for compatibility with ArrayList
1 parent 364f660 commit f9efd38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/main/java/com/thealgorithms/backtracking/ArrayCombination.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private static void combine(List<List<Integer>> combinations, List<Integer> curr
4848
for (int i = start; i < n; i++) {
4949
current.add(i);
5050
combine(combinations, current, i + 1, n, k);
51-
current.removeLast(); // Backtrack
51+
current.remove(current.size() - 1); // Backtrack
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)