📅  最后修改于: 2022-03-11 14:54:49.279000             🧑  作者: Mango
function removeDuplicates(&$nums)
{
$count = count($nums);
if (!$count) {
return 0;
}
$i = 0;
for ($j = 1; $j < $count; $j++) {
if ($nums[$j] !== $nums[$i]) {
$i++;
$nums[$i] = $nums[$j];
}
}
return ++$i;
}