Skip to content

Commit

Permalink
factorial and combination
Browse files Browse the repository at this point in the history
  • Loading branch information
mzusin committed Apr 23, 2024
1 parent b589dcc commit 12cf49d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/mz-math.esm.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/mz-math.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/mz-math.node.cjs.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/main/combinatorics/combinatorics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export const combinationsWithRepetition = () => {
* Example:
* --------
* Such as lottery numbers (2, 14, 15, 27, 30, 33).
*
* Tabulation (Bottom-Up Dynamic Programming).
* Time Complexity: 𝑂(n × r)
* Space Complexity: 𝑂(n × r)
*/
export const combinationsWithoutRepetition = (n: number, r: number) : number => {
if (n < 0 || r < 0) {
Expand Down

0 comments on commit 12cf49d

Please sign in to comment.