ARTS-Week-05

每周完成一个ARTS: 每周至少做一个 leetcode 的算法题、阅读并点评至少一篇英文技术文章、学习至少一个技术技巧、分享一篇有观点和思考的技术文章。(也就是 Algorithm、Review、Tip、Share 简称ARTS)

1.Algorithm

Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.

If there is no common prefix, return an empty string "".

Example 1:

1
2
Input: ["flower","flow","flight"]
Output: "fl"

Example 2:

1
2
3
Input: ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input strings.

Note:

All given inputs are in lowercase letters a-z.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution(object):
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if not strs:
return ''
max_str = max(strs)
min_str = min(strs)
for index, value in enumerate(min_str):
if value != max_str[index]:
return min_str[:index]
return min_str

2.Review

可以翻译,锻炼自己的阅读和英语能力。

英文文章可以去自己想要学习的技术官网获取,或者自己喜欢的公司 blog

在Hexo博客里引用Jupyter notebook内容

较全面的介绍了如何在博客里显示Jupyter Notebook格式的内容。

https://medium.com/@juanx002/blogging-jupyter-notebooks-ipynb-with-hexo-on-github-7948b72636dc

3.Tip

生活技巧,学习技巧、工具

在线时区换算工具

  • 以后会考虑自己写一个转换脚本

地址:http://www.timebie.com/

4.Share

Numpy简单使用

https://paranoid-kid.github.io/2019/04/30/Numpy简单使用/

小明 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
0%