ARTS #96 Algorithm 本周选择的算法题是:largest Rectangle in Histogram。 规则 Given an array of integers heights representing the histogram’s bar height where the width of each bar is 1, return the area of the largest... 2021-04-032 min read
2021 Q1 阅读记录 从去年开始对阅读做了些优化: 增加碎片时段阅读的时长 扩大阅读书籍的边界 根据书中内容调整阅读方式 优化后的效果还是很明显,今年的 Q1 就读了四本书。 发现心流 这是一本论述性的书,它的内核是: 探索人类快乐的本质,分析了人在不同的活动、环境、人际关系及受外在因素的影响下,对自身感受会造成的潜在影响。并说明了要在行为与思想上应当如何去做,才能乐在其中又或是苦... 2021-04-032 min read
ARTS #95 Algorithm 本周选择的算法题是:Minimum Window Substring。 规则 Given two strings s and t, return the minimum window in s which will contain all the characters in t. If there is no such window in s that covers... 2021-03-274 min read
HTTP 各版本之间的差异 前段时间做了一张思维导图,是关于 HTTP 各版本之间主要差异的,做这个的目的还是以梳理自己的知识为主,并借此机会了解下其中的算法: 源文件见: xmind。 2021-03-251 min read
ARTS #94 Algorithm 本周选择的算法题是:Copy List with Random Pointer。 规则 A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or ... 2021-03-2010 min read
Bignum in Python: 加减法运算 这篇文章记录 Bignum 的加减法运算规则,理解它的最好方式就是直接阅读 Python 源码,我所查阅的版本是 Python-3.9.2,下文引用的代码和分析都基于该版本。 从 Objects/longobject.c 文件里可以找到全部相关的代码,在我们往下之前,先介绍一个预备知识。 一个加法函数可以表示为两个处理绝对值的函数: 绝对值相加的函数 绝对值相减的函数 这... 2021-03-199 min read
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