ARTS #93 Algorithm 本周选择的算法题是:Symmetric Tree。 规则 Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3] O... 2021-03-134 min read
Bignum in Python: 内存中的存储 这篇文章主要记录 Python 是如何在从内存中表示 Bignum 的,由于 Python 使用 Bignum 表示所有的整型,所以这也是 Python 对整型的实现方式。 我们知道 Bignum 可以表示任意长度的数字,在内存上表示为一个数组,如数字: 51090942171709440000 可以表示为: [5, 1, 0, 9, 0, 9, 4, 2, 1, 7, 1, 7,... 2021-03-124 min read
ARTS #92 Algorithm 本周选择的算法题是:Permutations。 规则 Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Ou... 2021-03-063 min read
ROT-13 在 Python 里执行 import this 会打印如下字符串: The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complica... 2021-03-046 min read
ARTS #91 Algorithm 本周选择的算法题是:Word Search。 规则 Given an m x n board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where “adjacen... 2021-02-274 min read
《发现心流》讲了什么 《发现心流》是一本结构设计得非常好的书,作者像老师一样,带领读者认识心流体验、感受心流体验,并让读者充分认识到获得心流体验的门槛极低。虽然现实生活中也存在像童年悲惨、父母虐待、生活穷困等外在因素,但强调只要带着「面对挑战、解决问题、热爱命运」的态度,相信自己拥有主动权,就能掌握自得其乐的奥秘。 心流的产生 作者将活动分成了三个大类: 生产类 - 工作、学习等活动 维持类 - ... 2021-02-253 min read
ARTS #90 Algorithm 本周选择的算法题是:Valid Palindrome。 规则 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we ... 2021-02-203 min read
Review 的意义 需要提前说明:这篇谈论的 Review 并非是 Code Review,而是 ARTS 中的 Review。 陈皓老师曾在知乎上回答过一个问题:极客时间《左耳听风》发起的ARTS挑战怎么参加?,里面谈到了 Review 的动机: Review:主要是为了学习英文,如果你的英文不行,你基本上无缘技术高手。所以,需要你阅读并点评至少一篇英文技术文章,我个人最喜欢去的地方是Medium.... 2021-02-181 min read
ARTS #89 Algorithm 本周选择的算法题是:Merge k Sorted Lists。 规则 You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-lis... 2021-02-134 min read
CPython 中的超级大锁 多才多艺的 Python 被应用在网络开发、机器学习、数据科学、数据工程、数据分析和人工智能等各个领域,以至于近些年总是可以在各种榜单的前排看到它的身影: Python 有如今的成就,全靠它易于使用、结构简单的特点,产生了极高的开发效率,越来越多的开发人员正在或开始使用它。 初识 GIL 即便如此,Python 还是有一些问题在社区里被反复提及,最典型的问题就是 Python 的执... 2021-02-086 min read