Find the most common integer in an unsorted array.
Anonymous
'; //sort($arr); $arr1 = array(); foreach($arr as $temp){ if(array_key_exists($temp, $arr1)){ $arr1[$temp] +=1; }else{ $arr1[$temp] =1; } } $val = array_keys($arr1, max($arr1)); return $val; }
Check out your Company Bowl for anonymous work chats.