2019-04-24 吴亲库里 库里的深夜食堂
写一个函数反转数组中的字符串,要求是只能原地换,也就是说只能使用O(1)的空间复杂度.

/**
* @param String[] $s
* @return NULL
*/
function reverseString(&$s) {
$j=count($s)-1;
for($i=0;$i<$j;$i++){
$temp=$s[$i];
$s[$i]=$s[$j];
$s[$j]=$temp;
$j--;
};
return $s;
}
