
OJ
文章平均质量分 93
深海Enoch
我们的目标是星辰大海~
展开
-
LCP075 LeetCode 75. Sort Colors
Total Accepted: 100513 Total Submissions: 287992 Difficulty: MediumGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with原创 2016-05-31 17:48:08 · 457 阅读 · 0 评论 -
微软2016校招4月在线笔试——第一题 Font Size
http://hihocoder.com/problemset/problem/1288↑↑↑ 题目原址。时间限制:10000ms单点时限:1000ms内存限制:256MB描述Steven loves reading book on his phone. The book he reads now consists of N para原创 2016-04-07 10:02:17 · 703 阅读 · 0 评论 -
微软2016校招4月在线笔试——第二题 403Forbidden
http://hihocoder.com/problemset/problem/1289↑↑↑ 题目原址时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi runs a web server. Sometimes he has to deny access from a certain set o原创 2016-04-07 10:11:18 · 823 阅读 · 0 评论 -
LCP142 LeetCode142. Linked List Cycle II
一个更详尽、细致的第142题LeetCode的思路梳理。原创 2016-06-19 15:37:56 · 755 阅读 · 0 评论 -
LCP007 LeetCode 7 Reverse Integer
这里有N个坑。很考验基本功。最初拿到这道题,然后就去边洗衣服边想了。刚开始还想从 x 的高位开始向下,然后把 ans 的从低位到高位排起(川话)。然而太麻烦了。 后来想出了把 x 从低位向高位一位一位地吃掉,然后把啃下来的低位数字*10加上下一个啃下来的低位数字。这样的不算很麻烦的思路。 于是又开始了递归的规划过程。因为之前在朋友家完成第226题时,简直惊艳于某网友的简洁递归代码。“于是再也没能原创 2016-06-18 23:18:07 · 499 阅读 · 0 评论 -
LCP287 LeetCode 287. Find the Duplicate Number
这个题竟然跟LCP142是一样的~~!!!原创 2016-06-25 13:32:32 · 290 阅读 · 0 评论 -
LCP003 LeetCode 3. Longest Substring Without Repeating Characters
前言hash表~~ two pointers题目 Acceptance : 22.3% Difficulty : Medium Given a string, find the length of the longest substring without repeating characters. Examples : Given “abcabcbb”, th原创 2016-06-08 14:07:32 · 342 阅读 · 0 评论 -
LCP137 LeetCode 137. Single Number II
前言位运算。机器码。这里有个坑。题目 Acceptance : 38% Difficulty : Medium Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should ha原创 2016-06-08 11:41:58 · 333 阅读 · 0 评论 -
LCP164 LeetCode 164. Maximum Gap
新的开始 从上一篇关于汇编学习笔记的文章开始,将一律采用Markdown进行原创博客编写。 好吧, 这段纯粹是用来测试一下字颜色的。 题目Acceptance:27% Difficulty: Hard Give an unsorted array, find the maximum difference between the successive elements in its s原创 2016-06-06 13:37:56 · 448 阅读 · 0 评论 -
LCP104 LeetCode 104. Maximum Depth of Binary Tree
前言有一种代码的美简直让人拍案叫绝! 这道题目曾在阿里的电话面试中被问到过,当时想了大半天才憋出个蹩脚的解法,被指责算法水平太差。 今天看到这个题目,做了半天,还用了一个类下的全局变量。几次WA后终于试到了AC。beats 2.2% Solutions。 看了一个网友的四行C++代码,佩服得五体投地!题目 Acceptance:48.2% Difficulty: Easy Given原创 2016-06-06 23:54:09 · 332 阅读 · 0 评论 -
LCP260 LeetCode 260. Single Number III
前言LeetCode 上关于Single Number的题目一共三道:136. Single Number, 137. Single Number II, 260. Single Number III。 其中第一道很简单,只有一个数字只出现1次,其他出现了2次。从头到尾抑或一遍就找出结果了,不再开文写了。 第二道是只有一个数字出现了1次,其他数字出现了3次。额。。。这个暂时还没想出比较好的思路。原创 2016-06-07 12:10:38 · 335 阅读 · 0 评论 -
LCP242 LeetCode 242. Valid Anagram
前言hash表(或称散列表),想学很久了。知道这个原理,但是一直没有具体地应用或者实现过。 这道题目的tags有hash table,当然我用的也算是hash table,但是感觉还是差点事情。 Solution提交后beats 53%的Solution,应该还有更好的答案。题目 Acceptance: 42%, Difficulty: Easy Give two strings s an原创 2016-06-07 10:23:38 · 390 阅读 · 0 评论 -
LCP002 LeetCode 2. Add Two Numbers
2. Add Two Numbers My SubmissionsQuestionEditorial SolutionTotal Accepted: 147076 Total Submissions: 627191 Difficulty: MediumYou are given two linked lists representing two原创 2016-06-02 09:44:57 · 468 阅读 · 1 评论 -
LCP014 LeetCode 14. Longest Common Prefix
14. Longest Common Prefix My SubmissionsQuestionEditorial SolutionTotal Accepted: 102743 Total Submissions: 360716 Difficulty: EasyWrite a function to find the longest common原创 2016-06-01 11:17:18 · 448 阅读 · 2 评论 -
LCP342 LeetCode 342. Power of Four
前言来写个简单的题目。 位运算题目 Acceptance : 34.11% Difficulty : Easy Given an integer (singed 32 bits), write a function to check whether it is a power of 4. Example : Given num = 16, return tr原创 2016-06-08 15:27:34 · 583 阅读 · 3 评论