def solution(a, b, c) -> bool:
return sum((a, b)) > c and sum((a, c)) > b and sum((b, c)) > a
assert solution(1, 2, 2) is True
assert solution(7, 10, 5) is True
assert solution(1, 10, 12) is False
def solution(a, b, c) -> bool:
if a + b > c and a + c > b and b + c > a:
return True
else:
return False
assert solution(1, 2, 2) is True
assert solution(7, 10, 5) is True
assert solution(1, 10, 12) is False
def solution(a, b, c) -> bool:
return (a+b > c) and (a+c > b) and (b+c > a)
assert solution(1, 2, 2) is True
assert solution(7, 10, 5) is True
assert solution(1, 10, 12) is False
def solution15(a,b,c):
if a+b > c and a+c > b and b+c > a:
return True
else:
return False
assert solution15(1, 2, 2) is True
assert solution15(7, 10, 5) is True
assert solution15(1, 10, 12) is False
def solution(a, b, c) -> bool:
if a > 0 and b > 0 and c > 0 and a + b > c and b + c > a and c + a > b:
return True
else:
return False
assert solution(1, 2, 2) is True
assert solution(7, 10, 5) is True
assert solution(1, 10, 12) is False
public static boolean triangleVerify(int a, int b, int c) {
List<Integer> triangle_list = new ArrayList<>(Arrays.asList(a, b, c));
int max = Collections.max(triangle_list);
triangle_list.remove(Collections.max(triangle_list));
int sum = 0;
for (int i = 0; i < triangle_list.size(); i++) {
sum += triangle_list.get(i);
}
return sum > max;
}