1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<?php
class Solution
{
public function singleNumber($nums)
{
$single = 0;
foreach ($nums as $num)
{
$single ^= $num;
echo $num;
}
return $single;
}
}
$solution = new Solution();
echo $solution->singleNumber(array(1,1,2,3,2,4,4,5,3));
?>
|