ARTS第六周

第六周。后期补完,太忙了。

1.Algorithm:每周至少做一个 leetcode 的算法题
2.Review:阅读并点评至少一篇英文技术文章
3.Tip:学习至少一个技术技巧
4.Share:分享一篇有观点和思考的技术文章

以下是各项的情况:

Algorithm

链接:[LeetCode-15]-3sum

class Solution {
    public List<List<Integer>> threeSum(int[] nums) {
         List<List<Integer>> ans = new ArrayList();
        int len = nums.length;
        if(nums == null || len < 3) return ans;
        Arrays.sort(nums); // 排序
        for (int i = 0; i < len ; i++) {
            if(nums[i] > 0) break; // 如果当前数字大于0,则三数之和一定大于0,所以结束循环
            if(i > 0 && nums[i] == nums[i-1]) continue; // 去重
            int L = i+1;
            int R = len-1;
            while(L < R){
                int sum = nums[i] + nums[L] + nums[R];
                if(sum == 0){
                    ans.add(Arrays.asList(nums[i],nums[L],nums[R]));
                    while (L<R && nums[L] == nums[L+1]) L++; // 去重
                    while (L<R && nums[R] == nums[R-1]) R--; // 去重
                    L++;
                    R--;
                }
                else if (sum < 0) L++;
                else if (sum > 0) R--;
            }
        }        
        return ans;
    }
}

 

Review

 Category  Theory For Programer      

《程序员的范畴理论》https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/  

 

Tip

阻止在window10 上 安装 某个 windows Update

通过安装PowerShell模块并禁用不需要的Windows更新 。 更新现在将从Windows更新中隐藏,并且不会安装 。

 

Share

 微服务诞生的教训 

Ben Sigelman 发表的总结,他是Dapper(Google的分布式跟踪工具)的共同创始人以及开源OpenTracing API标准的共同创建者。将无服务器概念与微服务概念相结合,可能是未来的一个发展方向和趋势?

 

posted @ 2019-08-26 00:34  五行属鱼  阅读(163)  评论(0编辑  收藏  举报