ARTS-Week-03

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

1.Algorithm

Palindrome Number

Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.

Example 1:

1
2
Input: 121
Output: true

Example 2:

1
2
3
Input: -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.

Example 3:

1
2
3
Input: 10
Output: false
Explanation: Reads 01 from right to left. Therefore it is not a palindrome.

Code

1
2
3
4
5
6
7
8
class Solution(object):
def isPalindrome(self, x):
"""
:type x: int
:rtype: bool
"""
# 先转为String然后反转比较
return False if x < 0 else str(x) == str(x)[::-1]

2.Review

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

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

Using Machine Learning to Detect Malicious URLs

http://web.archive.org/web/20170514093208/http://fsecurify.com/using-machine-learning-detect-malicious-urls/

[原创翻译] 使用机器学习方法检测恶意URL

https://www.t00ls.net/thread-50650-1-1.html

3.Tip

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

使用Markdown排版微信公众号文章

wechat-format可转化 Markdown 到给微信特制的 HTML

项目地址:

https://github.com/lyricat/wechat-format

4.Share

[原创翻译] 使用机器学习方法检测恶意URL

https://www.t00ls.net/thread-50650-1-1.html

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