I was stuck in solving the following interview practice question: I have to write a function:
int triangle(int[] A);
that given a zero-
PHP Solution :
function solution($x){ sort($x); if (count($x) < 3) return 0; for($i = 2; $i < count($x); $i++){ if($x[$i] < $x[$i-1] + $x[$i-2]){ return 1; } } return 0; }