프로그래머스 코딩테스트 입문 삼각형의 완성조건 (2) [JAVA] - 22년 10월 4일

Denia·2022년 10월 4일
0

코딩테스트 준비

목록 보기
87/201
class Solution {
    public int solution(int[] sides) {
        int bigValue = Math.max(sides[0], sides[1]);
        int smallValue = Math.min(sides[0], sides[1]);

        int lowLimit = bigValue - smallValue;
        int highLimit = bigValue + smallValue;

        return highLimit - lowLimit - 1;
    }
}

profile
HW -> FW -> Web

0개의 댓글