[Programmers_CT] 32. 더 크게 합치기

문정준's avatar
Mar 21, 2025
[Programmers_CT] 32. 더 크게 합치기
 
💡
프로그래머스 코딩 테스트 30. 더 크게 합치기

1. 문제 설명

notion image
 

제한 사항

notion image

2. 입출력 예시

notion image

3. 코드 작성

class Solution { public int solution(int a, int b) { int answer = 0; String aa = Integer.toString(a); String bb = Integer.toString(b); int result1 = Integer.parseInt(aa+bb); int result2 = Integer.parseInt(bb+aa); answer = result1 >= result2 ? result1 : result2; return answer; } }

4. 테스트 실행

notion image

5. 제출 후 채점

notion image
Share article

sxias