mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-05 16:27:33 +08:00
Fix: Replaced removeLast() with remove(current.size() - 1) (#6152)
Fix: Replaced removeLast() with remove(current.size() - 1) for compatibility with ArrayList
This commit is contained in:
@ -48,7 +48,7 @@ public final class ArrayCombination {
|
||||
for (int i = start; i < n; i++) {
|
||||
current.add(i);
|
||||
combine(combinations, current, i + 1, n, k);
|
||||
current.removeLast(); // Backtrack
|
||||
current.remove(current.size() - 1); // Backtrack
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user