Remove unnecessary code (#4141)

This commit is contained in:
Saurabh Rahate
2023-04-03 20:05:59 +05:30
committed by GitHub
parent 805f09850c
commit ad72c28d91
64 changed files with 125 additions and 322 deletions

View File

@@ -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;
}