mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
Remove unnecessary code (#4141)
This commit is contained in:
@@ -52,8 +52,7 @@ public class Combinations {
|
||||
// nC0 is always 1
|
||||
long solution = 1;
|
||||
for (int i = 0; i < k; i++) {
|
||||
long next = (n - i) * solution / (i + 1);
|
||||
solution = next;
|
||||
solution = (n - i) * solution / (i + 1);
|
||||
}
|
||||
return solution;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user