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

프로그래머스 (181938)
Stupefyee's avatar
Feb 25, 2025
[JAVA 문제 풀이] 104. 두 수의 연산값 비교하기
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

stupefyee