강의

멘토링

로드맵

Inflearn Community Q&A

operland88's profile image
operland88

asked

Introduction to Javascript Algorithm Problem Solving (Coding Test Preparation)

2. Identifying triangles

이런식으로 풀었는데..괜찮을까요

Written on

·

265

0

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
    function solution(a, b, c) {
      if (a + b < c) {
        console.log('No')
      } else if (a + c < b) {
        console.log('NO')
      } else if (c + b < a) {
        console.log('NO')
      } else {
        console.log('YES')
      }

    }
    console.log(solution(6, 13, 20));
    console.log(solution(33, 40, 6));

이렇게 풀면 좀 방식이 이상한가요..? 일단 이렇게 했는데 비교해보니 좀달라서..

javascript코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

위와같이 해도 상관없어 보입니다.

operland88's profile image
operland88

asked

Ask a question