inblog logo
|
stupefyee
    알고리즘문제풀기

    [JAVA 문제 풀이] 104. 두 수의 연산값 비교하기

    프로그래머스 (181938)
    Stupefyee's avatar
    Stupefyee
    Feb 25, 2025
    [JAVA 문제 풀이] 104. 두 수의 연산값 비교하기
    Contents
    내가 작성한 코드
    school.programmers.co.kr
    https://school.programmers.co.kr/learn/courses/30/lessons/181938
    notion image
     

    내가 작성한 코드

    class Solution { public int solution(int a, int b) { int result1 = Integer.parseInt("" + a + b); int result2 = 2 * a * b; return result1 >= result2 ? result1 : result2; // return Math.max(Integer.parseInt("" + a + b), 2 * a * b); 한줄로 줄여보기 } }
     
    Share article
    Contents
    내가 작성한 코드

    stupefyee

    RSS·Powered by Inblog