You are viewing a single comment's thread. Return to all comments →
Here is a PHP version. $arr is the input array.
`$res = array_reduce($`arr, function(`$carry, $`val) {(`$val>0)?$`carry[0]++:((`$val<0)?$`carry[1]++:`$carry[2]++); return $`carry;},[]); printf ("%f\n%f\n%f", `$res[0]/$`n, `$res[1]/$`n, `$res[2]/$`n);
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Here is a PHP version. $arr is the input array.