Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$seq = [20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5];
function findIt(array $seq)
{
$arr = array_count_values($seq);
$res = array_keys(array_filter($arr, "el"));
return $res;
}
function el($a){
return $a >= 1 && $a % 2;
}
print_r(findIt($seq));