
class Solution {
public int solution(int hp) {
int cnt = 0;
cnt += (hp / 5);
hp %= 5;
cnt += (hp / 3);
hp %= 3;
cnt += (hp / 1);
return cnt;
}
}

class Solution {
public String solution(String letter) {
String[] morse = {".-","-...","-.-.","-..",".","..-.",
"--.","....","..",".---","-.-",".-..","--","-.",
"---",".--.","--.-",".-.","...","-","..-","...-",
".--","-..-","-.--","--.."};
String[] morseString;
morseString = letter.split(" ");
StringBuilder sb = new StringBuilder();
for (String word : morseString) {
for (int i = 0; i < morse.length; i++) {
if (word.equals(morse[i])) sb.append(Character.toString(i + 'a'));
}
}
return sb.toString();
}
}

class Solution {
public String solution(String rsp) {
String answer = "";
String[] arr = rsp.split("");
for (int i = 0; i < arr.length; i++) {
if (arr[i].equals("2")) {
answer += "0";
} else if (arr[i].equals("0")) {
answer += "5";
} else {
answer += "2";
}
}
return answer;
}
}


class Solution {
public int solution(int balls, int share) {
return combination(balls, share);
}
public static int combination(int balls, int share){
if(balls == share || share == 0) return 1;
return combination((balls -1), (share -1)) + combination(balls - 1, share);
}
}
팩토리얼 재귀함수를 사용해서 푸는 문제
0! = 1 (0의 팩토리얼은 정의 상 1로 정의함)
1! = 1
2! = 2 × 1 = 2
3! = 3 × 2 × 1 = 6
4! = 4 × 3 × 2 × 1 = 24
5! = 5 × 4 × 3 × 2 × 1 = 120