function solution(sides) {
let arr = [];
let maxNum = Math.max(...sides);
let otherNum = Math.min(...sides);
let case1num = maxNum - otherNum + 1;
let case2num = maxNum + otherNum - 1;
for (let i = case1num; i <= maxNum; i++) {
arr.push(i);
}
for (let j = case2num; j > maxNum; j--) {
arr.push(j);
}
return arr.length;
}
sides = [a,b] 중에서 maxNum이 b라고 했을때,
나머지 숫자 c는 maxNum보다 작거나 같아야하고, maxNum - a 보다 커야한다.
a, b 가 아니라 나머지 값 c가 maxNum 이라고 했을때,
c는 a와 b중 더 큰수보다 커야하고, a+b 를 합친 값보단 작아야한다.