알고리즘

JS 삼각형인지 확인하기

KairoYang 2020. 8. 26. 15:12

[문제] Implement a method that accepts 3 integer values a, b, c. The method should return true if a triangle can be built with the sides of given length and false in any other case.

 

(In this case, all triangles must have surface greater than 0 to be accepted).

 

Test.describe("PublicTest", function() {

    Test.assertEquals(isTriangle(1,2,2), true);

    Test.assertEquals(isTriangle(7,2,2), false);

});

 

 



출처: https://im-developer.tistory.com/35?category=831367 [Code Playground]