인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

Jade Kang's profile image
Jade Kang

asked

Introduction to Javascript Algorithm Problem Solving (Coding Test Preparation)

2. Identifying triangles

이렇게 해도 괜찮나요?

Written on

·

180

0

const isItTriangle = (A, B, C) => {
  // Step 1: Construct a function that takes three arguments
  // Step 2: Compare the sum of two values to one arg
  // Step 3: If the sum is greater than the one arg, return true otherwise false
  if (A + B > C && A + C > B && B + C > A) {
    return 'YES';
  } else {
    return 'NO';
  }
}

console.log('Case 1: ' + isItTriangle(6, 7, 11));
console.log('Case 2: ' + isItTriangle(13, 33, 17));

const answer2 = document.querySelector('#q3');
answer2.append(isItTriangle);
bigO코테 준비 같이 해요! javascript

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

네. 상관없습니다.

Jade Kang's profile image
Jade Kang

asked

Ask a question