I scored 66% in #php on @Codility!
https://codility.com/demo/take-sample-test/odd_occurrences_in_array/
I don't know how to do better yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// you can write to stdout for debugging purposes, e.g. | |
// print "this is a debug message\n"; | |
function solution($A) { | |
$a_count_values = array_count_values($A); | |
$values = array_keys($a_count_values, 1); | |
if (is_array($values)) | |
return $values[0]; | |
return $values; | |
} |
Training ticket
Session
ID: training8BGA3Q-8PA
Time limit: 120 min.
Status: closed
Created on: 2016-01-17 03:06 UTC
Started on: 2016-01-17 03:06 UTC
Finished on: 2016-01-17 03:07 UTC