class Solution {
public static int solution(int balls, int share) {
int answer = 0;
answer = factorial(balls, share);
return answer;
}
public static int factorial(int n , int m){
if( m == 0 || n == m){
return 1;
}else{
return factorial(n -1 , m - 1) + factorial(n-1, m);
}
}
}
추가 설명 ->
2023.08.18 - [➜ 기타] - 조합과 파스칼의 삼각형의 관계에 대해서
조합과 파스칼의 삼각형의 관계에 대해서
2023.08.18 - [➜ 코딩 테스트/프로그래머스] - 프로그래머스 - 구슬을 나누는 경우의 수 (JAVA) 프로그래머스 - 구슬을 나누는 경우의 수 (JAVA) class Solution { public static int solution(int balls, int share) { int ans
mangseok.tistory.com