Last active
September 23, 2017 23:15
-
-
Save DmitryMyadzelets/b1e4444b3ddab8a3c4a46bbadd44f7d8 to your computer and use it in GitHub Desktop.
Combination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const factorial = (n) => n ? n * factorial(n - 1) : 1 | |
// Given n, choose k - [Combination](https://en.wikipedia.org/wiki/Combination) | |
const C = (n, k) => factorial(n) / (factorial(k) * factorial(n-k)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment