mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 02:53:31 +08:00
添加 0977.有序数组的平方 PHP版本注释
This commit is contained in:
@ -278,6 +278,7 @@ class Solution {
|
|||||||
* @return Integer[]
|
* @return Integer[]
|
||||||
*/
|
*/
|
||||||
function sortedSquares($nums) {
|
function sortedSquares($nums) {
|
||||||
|
// 双指针法
|
||||||
$res = [];
|
$res = [];
|
||||||
for ($i = 0; $i < count($nums); $i++) {
|
for ($i = 0; $i < count($nums); $i++) {
|
||||||
$res[$i] = 0;
|
$res[$i] = 0;
|
||||||
|
Reference in New Issue
Block a user