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);
return array_keys(array_filter($arr, fn($el) => $el > 0 && $el % 2));
}
print_r(findIt($seq)[0]);