Skip to content

Commit

Permalink
Fix: Replaced removeLast() with remove(current.size() - 1) (#6152)
Browse files Browse the repository at this point in the history
Fix: Replaced removeLast() with remove(current.size() - 1) for compatibility with ArrayList
  • Loading branch information
MaddyRizvi authored Jan 26, 2025
1 parent 364f660 commit f9efd38
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private static void combine(List<List<Integer>> combinations, List<Integer> curr
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
}
}
}

0 comments on commit f9efd38

Please sign in to comment.