728x90
class Solution {
public String solution(String bin1, String bin2) {
int i1 = Integer.parseInt(bin1, 2);
int i2 = Integer.parseInt(bin2, 2);
return Integer.toBinaryString(i1+i2);
}
}
Intger클래스의 메서드를 이용해서 풀면 간단한 것을 결국 못 풀고 검색해서 풀었다...
반응형
'CodingTest > Programmers' 카테고리의 다른 글
| [프로그래머스] Lv0 공 던지기* (0) | 2023.01.10 |
|---|---|
| [프로그래머스] Lv0 숨어있는 숫자의 덧셈 (2) (0) | 2023.01.09 |
| [프로그래머스] Lv.0 7의 개수 (0) | 2022.12.28 |
| [프로그래머스] Lv.0 진료순서 정하기** (0) | 2022.12.19 |
| [프로그래머스] Lv.0 가까운 수 (1) | 2022.12.15 |
댓글