LeetCode 41. First Missing Positive 这个题目虽然是Hard,但是只要想到解法之后,就很简单了。 题目要求:找到最小的、没有出现在数组中的整数,数组未排序。 初看起来,这个至少得排个序才能搞定。但是题目说了,时间复杂度O(n),空间复杂度O(1)。 如果能把数字n填写到第n-1个,那不就能在O(n)时间内看出来缺失数字了吗?把数字n填写到第n-1个,完全就是遍历一遍所有的数字就可以了啊。 思路就这样出来了: 遍历所有数字,将数字n放 2019-04-14 LeetCode #LeetCode
Firefox无法播放mp4格式的视频(Fedora) 最近又开始用起来Fedora了,昨天发现Firefox没法看视频: console提示如下: HTTP “Content-Type” of “video/mp4” is not supported. Load of media resource https://example.com/incorrect\_feedback.mp4 failed.VIDEOJS: ERROR: (COD 2019-04-11 Tips
Wordpress报错“e.visibility is undefined” 在我的博客上,一直无法用Wordpress的古腾堡编辑器来编辑。 一打开就出现这个页面: console上报错:“e.visibility is undefined”: 搜了下,发现确实有人提issue:https://github.com/WordPress/gutenberg/issues/12655。但是神奇的是,问题是由nginx配置导致的。 我原来在Nginx中对Wordpress的 2019-04-10 Tips
为何一次请求会有两次HttpServlet:service调用? 今天看了下阿里出的 Arthas,使用文档中有问到: 为什么只访问了http://localhost:8080/a.txt,但Arthas的trace命令打印出了两个请求树? 然后我去自己试了下,发现还真的是这个情况,trace日志如下: 1234567891011121314151617`---ts=2019-02-24 18:05:20;thread_name=http-nio-8080- 2019-02-24 Language > Java #Java
Leetcode 990: 等式的满足性 题目来源:https://leetcode.com/problems/satisfiability-of-equality-equations/ 题目描述:给一字符串数组,每个元素是一个等式,表示两个变量之间的关系。每个等式长度为4,形如 “a==b” 或者 “a!=b”,a 和 b 两个小写字母表示变量名,a和b可能相同。 如果能给这些变量分配数字,并满足这些等式, 2019-02-20 LeetCode #LeetCode
《怪屋女孩:灵魂博物馆》 刚刚读完了 Library of Souls - The Third Novel of Miss Peregrine’s Peculiar Children 我读这本书其实是为了学英语,但作为一本冒险小说,设定还是很有新意的,尤其是那些照片,还有男主的女朋友! 不过,这种故事是典型的英雄之旅(Hero’s journey)的模版。读到最后,回忆主角经历的种种,恍若隔世,还是蛮温馨的。 接下来是我 2018-12-12 Read #english
Billionaire The topic is billionaire, namely, If you had a billion dollars, what would you do. How about browsers billionaires firstly? No, it isn’t interesting. What can we do with those non-existent one billion 2018-11-10 english
The woman on the bus was molested On 25th, Sep, domestic violence happened at a bus at Beiliu City, Guangxi Provence. According to the video, a woman moved to bus’s roar exit gate, trying to get off at the next station. The man pulled 2018-09-28 english
How to enable AV1 support? AV1 is a product of the Alliance for Open Media (AOM). AOM was founded in September 2015 by Google, Mozilla, Cisco, Microsoft, Netflix, Amazon, and Intel to create the next generation video codec for 2018-09-23 uncategorized
A freshman was expelled, because of killing a stray cat In 10th, Sep, a stray cat was killed, by bows and arrows. A member from the animal protection society of HBUE(Hubei University of Economics) said that the cat was found in the trash, then sent to the 2018-09-21 english