1. ๋ฌธ์ ์ค๋ช ๐
2. ์ ๊ทผ ๋ฐฉ์ ๐๏ธ
KEY WORD
: SIMULATION
3. ์ฝ๋ ์๊ฐ ๐
import java.util.*;
class Solution {
public int solution(int[] wallet, int[] bill) {
int answer = 0;
Arrays.sort(wallet); Arrays.sort(bill);
while(wallet[0] < bill[0] || wallet[1] < bill[1]){
answer += 1;
bill[1] /=2;
Arrays.sort(bill);
}
return answer;
}
}
4. ๋ฐฐ์ด ๊ฒ๋ค ๐ฏ
์์. ๊พธ์คํจ์ ์ํ ์ฌ๋ฌผ
0