[프로그래머스]더 크게 합치기

박예림·2023년 5월 25일
0

코테

목록 보기
91/132

class Solution {
    public int solution(int a, int b) {
        String strAB = (a+"")+(b+"");
        String strBA = (b+"")+(a+"");

        int ab = Integer.parseInt(strAB);
        int ba = Integer.parseInt(strBA);

        if (ab == ba) {
            return ab;
        }
        return Math.max(ab, ba);
    }
}
profile
응애 나 아기개발자

0개의 댓글