-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathis_this_a_triangle.js
More file actions
20 lines (19 loc) · 1.54 KB
/
is_this_a_triangle.js
File metadata and controls
20 lines (19 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/******************************************************************************************
* CODEWARS IS THIS A TRIANGLE CHALLENGE *
* *
* Problem Statement *
* 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). *
* *
* Examples *
* Input 1: (1,2,2) *
* Output 1: true *
* *
* Input 2: (7,2,2) *
* Output 2: false *
* *
*****************************************************************************************/
function isTriangle(a, b, c) {
return (a + b <= c || a + c <= b || b + c <= a) ? false : true;
}