左耳听风 ARTS Week1

Algorithm

每周至少做一个 Leetcode 的算法题。

move-zeroes

class Solution {

    /**
     * @param Integer[] $nums
     * @return NULL
     */
   function moveZeroes(&$nums)
    {
        $arr  =[];
        $count = count($nums);//数组长度
        if($count || ($count!=1)){
            for ($i = 0; $i<$count; $i++) {
                    if ($nums[$i]) {
                        $arr[] = $nums[$i];
                    }
                }
                $countNotNUll = count($arr);
                for ($i = 0; $i<$countNotNUll; $i++) {
                    $nums[$i] = $arr[$i];
                }
                if($count - $countNotNUll){
                    for ($i = $countNotNUll; $i<$count; $i++) {
                    $nums[$i] = 0;
                    }
                }
        }

    }
}

Review

阅读并点评至少一篇英文技术文章。

20 Things I've Learned in my 20 Years as a Software Engineer - Simple Thread

https://www.simplethread.com/20-things-ive-learned-in-my-20-years-as-a-software-engineer/

Tip

学习至少一个技术技巧。

不懂就要问,不要不懂装懂.特别是需求,一定清晰理解;

Share

分享一篇有观点和思考的技术文章。

GO语言有哪些常用框架?链接



欢迎关注公-众-号【TaonyDaily】、留言、评论,一起学习。

公众号

Don’t reinvent the wheel, library code is there to help.

文章来源:刘俊涛的博客


若有帮助到您,欢迎点赞、转发、支持,您的支持是对我坚持最好的肯定(_)

posted @ 2023-08-20 23:54  刘俊涛的博客  阅读(12)  评论(0编辑  收藏  举报