Skip to content

Instantly share code, notes, and snippets.

@capfsb
Created February 24, 2018 09:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capfsb/c857127d6252170991aec127c7fbae77 to your computer and use it in GitHub Desktop.
Save capfsb/c857127d6252170991aec127c7fbae77 to your computer and use it in GitHub Desktop.
<?
$a=[1,1,1,2,3,3,4,5,5,5,5,6,6,6,6];
foreach($a as $v)
{
$count[$v] = $count[$v] ?? 0;
++$count[$v];
}
echo join(' ',array_keys(array_filter($count,function($v){return $v % 2 == 1;})));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment