728x90
반응형
문제
반응형
풀이
1
2
3
4
5
6
7
8
9
10
11
|
import java.math.BigInteger;
class Solution {
public String addBinary(String a, String b) {
BigInteger a1 = new BigInteger(a, 2);
BigInteger b1 = new BigInteger(b, 2);
BigInteger sum = a1.add(b1);
return sum.toString(2);
}
}
|
cs |
728x90
반응형
'[JAVA] LeetCode > Easy' 카테고리의 다른 글
[LeetCode/릿코드] 70. Climbing Stairs (0) | 2023.01.24 |
---|---|
[LeetCode/릿코드] 69. Sqrt(x) (0) | 2023.01.24 |
[LeetCode/릿코드] 66. Plus One (0) | 2023.01.24 |
[LeetCode/릿코드] 58. Length of Last Word (0) | 2023.01.24 |
[LeetCode/릿코드] 35. Search Insert Position (0) | 2023.01.13 |