You are viewing a single comment's thread. Return to all comments →
PHP one more
function getTotalX(array $a, array $b):int { $res=0; for($i=end($a);$i<=$b[0];$i++) { $count1=0; $count2=0; for($j=0;$j<count($a);$j++){ $i % $a[$j] === 0 ? $count1++ : ''; } for($j=0;$j<count($b);$j++){ $b[$j] % $i == 0 ? $count2++ : ''; } if($count1 == count($a) && $count2 == count($b)) { $res++; } } return $res; }
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
PHP one more