Skip to content

Commit

Permalink
이슈 #374에서 솔루션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 21, 2024
1 parent 9e7dc30 commit c8fd63b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Programmers/구슬을_나누는_경우의_수.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <string>
#include <vector>

using namespace std;

int combination(int n, int m) {
if (n == m) return 1;
if (m == 1) return n;

return combination(n - 1, m - 1) + combination(n - 1, m);
}

int solution(int balls, int share) {
return combination(balls, share);
}

0 comments on commit c8fd63b

Please sign in to comment.