First week

1 Algorithm

1.1 problem

Two sum

1.2 solution

First solution is using two for sentences,but the complexity is O(n^2);we can use the hash map.

class Solution:
    def twoSum(self, nums, target):
        hash_map = dict()
        for i,x in enumerate(nums):
            if target - x in hash_map:
                return [i,hash_map[target-x]]
            hash_map[x] = i
        

2 Review

10 Basic Programming Principles Every Programmer Must Follow

I think these tips is very good for us to cooperate with the other team members. I suppose the software is art the same as the architecture,but when we pursue the excellent skills, we must remember why we need write code.

3 Tip

Create a MSBuild Project
when our team use the visual studio to develop software, many times unexpected error occurs in our project, so we can write the project file line by line, it can decrease many bugs.

4 Share

Recursion play an important role in the algorithm. I think the recursion is a way that thinking from end to start. In our life, I supposed that thinking how to living from the death to now is better than thinking now based the future. The idea called by Chinese is "向死而生".

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,163评论 0 10
  • 六月的栀子开得白玉似的,玄城商铺的灯光一盏一盏的熄灭。大户人家高阔门檐的红灯笼一盏一盏的在栀子花的香气里浮起来,微...
    花灵007阅读 2,338评论 0 0
  • 天底下欠钱还钱,欠债还债本就是天经地义的事情。只是在人世间最不能欠的就是——人情债 如若让你回到三年前或X年前你会...
    千凌落秋阅读 3,280评论 2 11
  • 在所有朝三暮四里,我最喜欢你
    望穿他盈盈秋水阅读 1,352评论 0 0