Leetcode Solutions
Language: javascript c mysql
Last updated: 2019-01-04
https://github.com/nusr/leetcode
# |
Problems |
Solutions |
Difficulty |
Acceptance |
Paid-Only |
001 |
two-sum |
c,javascript |
Easy |
39.69% |
No |
002 |
add-two-numbers |
javascript |
Medium |
30.01% |
No |
007 |
reverse-integer |
javascript |
Easy |
24.87% |
No |
008 |
string-to-integer-atoi |
javascript |
Medium |
14.34% |
No |
009 |
palindrome-number |
javascript,c |
Easy |
40.67% |
No |
013 |
roman-to-integer |
javascript |
Easy |
50.84% |
No |
020 |
valid-parentheses |
javascript |
Easy |
35.40% |
No |
021 |
merge-two-sorted-lists |
javascript |
Easy |
44.75% |
No |
027 |
remove-element |
c,javascript |
Easy |
42.90% |
No |
028 |
implement-strstr |
javascript |
Easy |
30.73% |
No |
035 |
search-insert-position |
c,javascript |
Easy |
40.21% |
No |
050 |
powx-n |
javascript |
Medium |
27.17% |
No |
053 |
maximum-subarray |
javascript,c |
Easy |
42.17% |
No |
058 |
length-of-last-word |
c |
Easy |
32.09% |
No |
065 |
valid-number |
javascript |
Hard |
13.57% |
No |
066 |
plus-one |
javascript |
Easy |
40.36% |
No |
067 |
add-binary |
javascript |
Easy |
37.10% |
No |
069 |
sqrtx |
c |
Easy |
30.13% |
No |
070 |
climbing-stairs |
javascript |
Easy |
42.73% |
No |
083 |
remove-duplicates-from-sorted-list |
c |
Easy |
41.51% |
No |
100 |
same-tree |
javascript |
Easy |
49.02% |
No |
102 |
binary-tree-level-order-traversal |
javascript |
Medium |
46.07% |
No |
104 |
maximum-depth-of-binary-tree |
javascript |
Easy |
58.24% |
No |
107 |
binary-tree-level-order-traversal-ii |
javascript |
Easy |
44.89% |
No |
110 |
balanced-binary-tree |
c,javascript |
Easy |
39.93% |
No |
111 |
minimum-depth-of-binary-tree |
javascript |
Easy |
34.54% |
No |
118 |
pascals-triangle |
javascript |
Easy |
43.51% |
No |
119 |
pascals-triangle-ii |
javascript |
Easy |
41.09% |
No |
121 |
best-time-to-buy-and-sell-stock |
c,javascript |
Easy |
45.45% |
No |
125 |
valid-palindrome |
c |
Easy |
29.54% |
No |
136 |
single-number |
javascript |
Easy |
58.07% |
No |
144 |
binary-tree-preorder-traversal |
javascript |
Medium |
49.51% |
No |
160 |
intersection-of-two-linked-lists |
javascript |
Easy |
31.21% |
No |
167 |
two-sum-ii-input-array-is-sorted |
javascript |
Easy |
48.39% |
No |
169 |
majority-element |
c,javascript |
Easy |
50.68% |
No |
175 |
combine-two-tables |
mysql |
Easy |
47.55% |
No |
189 |
rotate-array |
javascript,c |
Easy |
28.06% |
No |
190 |
reverse-bits |
javascript |
Easy |
29.43% |
No |
191 |
number-of-1-bits |
c |
Easy |
41.18% |
No |
202 |
happy-number |
c |
Easy |
43.68% |
No |
203 |
remove-linked-list-elements |
c |
Easy |
34.87% |
No |
204 |
count-primes |
javascript |
Easy |
27.66% |
No |
206 |
reverse-linked-list |
c |
Easy |
51.36% |
No |
217 |
contains-duplicate |
c,javascript |
Easy |
49.94% |
No |
226 |
invert-binary-tree |
javascript,c |
Easy |
56.23% |
No |
231 |
power-of-two |
c |
Easy |
41.42% |
No |
234 |
palindrome-linked-list |
c |
Easy |
34.84% |
No |
237 |
delete-node-in-a-linked-list |
javascript |
Easy |
50.88% |
No |
242 |
valid-anagram |
javascript |
Easy |
50.10% |
No |
258 |
add-digits |
c |
Easy |
53.14% |
No |
263 |
ugly-number |
c |
Easy |
40.21% |
No |
268 |
missing-number |
javascript,c |
Easy |
46.92% |
No |
283 |
move-zeroes |
c,javascript |
Easy |
53.11% |
No |
326 |
power-of-three |
c |
Easy |
41.21% |
No |
342 |
power-of-four |
javascript,c |
Easy |
39.82% |
No |
344 |
reverse-string |
c |
Easy |
62.22% |
No |
345 |
reverse-vowels-of-a-string |
javascript |
Easy |
40.43% |
No |
349 |
intersection-of-two-arrays |
javascript |
Easy |
51.75% |
No |
350 |
intersection-of-two-arrays-ii |
javascript |
Easy |
46.07% |
No |
367 |
valid-perfect-square |
c |
Easy |
39.09% |
No |
371 |
sum-of-two-integers |
javascript |
Easy |
51.26% |
No |
387 |
first-unique-character-in-a-string |
javascript |
Easy |
48.35% |
No |
389 |
find-the-difference |
javascript |
Easy |
52.40% |
No |
396 |
rotate-function |
javascript |
Medium |
34.62% |
No |
434 |
number-of-segments-in-a-string |
c |
Easy |
36.49% |
No |
441 |
arranging-coins |
c |
Easy |
37.11% |
No |
442 |
find-all-duplicates-in-an-array |
javascript |
Medium |
59.12% |
No |
461 |
hamming-distance |
c |
Easy |
69.72% |
No |
476 |
number-complement |
javascript |
Easy |
61.78% |
No |
485 |
max-consecutive-ones |
javascript,c |
Easy |
54.14% |
No |
504 |
base-7 |
javascript |
Easy |
44.32% |
No |
507 |
perfect-number |
javascript |
Easy |
32.78% |
No |
520 |
detect-capital |
c |
Easy |
52.06% |
No |
535 |
encode-and-decode-tinyurl |
javascript |
Medium |
75.13% |
No |
541 |
reverse-string-ii |
javascript |
Easy |
44.72% |
No |
551 |
student-attendance-record-i |
javascript |
Easy |
45.04% |
No |
557 |
reverse-words-in-a-string-iii |
javascript |
Easy |
62.40% |
No |
561 |
array-partition-i |
c,javascript |
Easy |
67.77% |
No |
595 |
big-countries |
mysql |
Easy |
72.43% |
No |
617 |
merge-two-binary-trees |
javascript |
Easy |
68.47% |
No |
620 |
not-boring-movies |
mysql |
Easy |
60.44% |
No |
627 |
swap-salary |
mysql |
Easy |
68.12% |
No |
637 |
average-of-levels-in-binary-tree |
javascript |
Easy |
57.41% |
No |
654 |
maximum-binary-tree |
c,javascript |
Medium |
71.08% |
No |
657 |
robot-return-to-origin |
javascript |
Easy |
70.17% |
No |
700 |
search-in-a-binary-search-tree |
c |
Easy |
64.86% |
No |
701 |
insert-into-a-binary-search-tree |
javascript,c |
Medium |
71.43% |
No |
709 |
to-lower-case |
javascript |
Easy |
75.25% |
No |
728 |
self-dividing-numbers |
javascript |
Easy |
68.17% |
No |
771 |
jewels-and-stones |
javascript |
Easy |
82.32% |
No |
804 |
unique-morse-code-words |
javascript |
Easy |
72.79% |
No |
832 |
flipping-an-image |
javascript |
Easy |
70.36% |
No |
852 |
peak-index-in-a-mountain-array |
javascript |
Easy |
68.20% |
No |
867 |
transpose-matrix |
javascript |
Easy |
63.43% |
No |
868 |
binary-gap |
javascript |
Easy |
59.17% |
No |
872 |
leaf-similar-trees |
javascript |
Easy |
61.40% |
No |
876 |
middle-of-the-linked-list |
javascript |
Easy |
63.02% |
No |
884 |
uncommon-words-from-two-sentences |
javascript |
Easy |
60.41% |
No |
905 |
sort-array-by-parity |
javascript |
Easy |
71.56% |
No |
922 |
sort-array-by-parity-ii |
javascript |
Easy |
66.26% |
No |
929 |
unique-email-addresses |
javascript |
Easy |
79.78% |
No |
938 |
range-sum-of-bst |
javascript |
Medium |
80.73% |
No |
961 |
n-repeated-element-in-size-2n-array |
javascript,c |
Easy |
73.70% |
No |
965 |
univalued-binary-tree |
javascript,c |
Easy |
72.55% |
No |
- 【LeetCode题解】二叉树的遍历
我准备开始一个新系列[LeetCode题解],用来记录刷LeetCode题,顺便复习一下数据结构与算法. 1. 二叉树 二叉树(binary tree)是一种极为普遍的数据结构,树的每一个节点最多只有 ...
- leetcode题解-122买卖股票的最佳时期
题目 leetcode题解-122.买卖股票的最佳时机:https://www.yanbinghu.com/2019/03/14/30893.html 题目详情 给定一个数组,它的第 i 个元素是一支 ...
- 【LeetCode题解】3_无重复字符的最长子串(Longest-Substring-Without-Repeating-Characters)
目录 描述 解法一:暴力枚举法(Time Limit Exceeded) 思路 Java 实现 Python 实现 复杂度分析 解法二:滑动窗口(双指针) 思路 Java 实现 Python 实现 复 ...
- 【LeetCode题解】225_用队列实现栈(Implement-Stack-using-Queues)
目录 描述 解法一:双队列,入快出慢 思路 入栈(push) 出栈(pop) 查看栈顶元素(peek) 是否为空(empty) Java 实现 Python 实现 解法二:双队列,入慢出快 思路 入栈 ...
- 【LeetCode题解】232_用栈实现队列(Implement-Queue-using-Stacks)
目录 描述 解法一:在一个栈中维持所有元素的出队顺序 思路 入队(push) 出队(pop) 查看队首(peek) 是否为空(empty) Java 实现 Python 实现 解法二:一个栈入,一个栈 ...
- 【LeetCode题解】844_比较含退格的字符串(Backspace-String-Compare)
目录 描述 解法一:字符串比较 思路 Java 实现 Python 实现 复杂度分析 解法二:双指针(推荐) 思路 Java 实现 Python 实现 复杂度分析 更多 LeetCode 题解笔记可以 ...
- 【LeetCode题解】25_k个一组翻转链表(Reverse-Nodes-in-k-Group)
目录 描述 解法一:迭代 思路 Java 实现 Python 实现 复杂度分析 解法二:递归(不满足空间复杂度) 思路 Java 实现 Python 实现 复杂度分析 更多 LeetCode 题解笔记 ...
- 【LeetCode题解】24_两两交换链表中的节点(Swap-Nodes-in-Pairs)
目录 描述 解法一:迭代 思路 Java 实现 Python 实现 复杂度分析 解法二:递归(不满足空间复杂度要求) 思路 Java 实现 Python 实现 复杂度分析 更多 LeetCode 题解 ...
- 【LeetCode题解】347_前K个高频元素(Top-K-Frequent-Elements)
目录 描述 解法一:排序算法(不满足时间复杂度要求) Java 实现 Python 实现 复杂度分析 解法二:最小堆 思路 Java 实现 Python 实现 复杂度分析 解法三:桶排序(bucket ...
- 【LeetCode题解】19_删除链表的倒数第N个节点(Remove-Nth-Node-From-End-of-List)
目录 描述 解法:双指针 思路 Java 实现 Python 实现 复杂度分析 更多 LeetCode 题解笔记可以访问我的 github. 描述 给定一个链表,删除链表的倒数第 n 个节点,并且返回 ...
随机推荐
- 理解Flexbox弹性盒子
http://www.w3cplus.com/css3/understanding-flexbox-everything-you-need-to-know.html参考文档 1:要开始使用Flexbo ...
- CentOS 6.2+Nginx+Nagios,手机短信和qq邮箱提醒
http://chenhao6.blog.51cto.com/6228054/1323192 标签:软件包 配置文件 nagios 服务端 监控 原创作品,允许转载,转载时请务必以超链接形式标明文章 ...
- jQuery的入口函数四种写法
1.第一种: $(document).ready(function(){ }); 2.第二种(最简洁的写法,推荐): $(function(){ }); 3.第三种: jQuery(document) ...
- Maven项目中,系统设置的CLASSPATH环境变量问题
在Maven项目中,系统的CLASSPATH环境变量失效了吗?在用Maven开发登录网站时,servlet-api出现错误,jdbc也出现错误,都是ClassNotFoundException,但这两 ...
- 查询订阅某topic的所有consumer group(Java API)
在网上碰到的问题,想了下使用现有的API还是可以实现的. 首先,需要引入Kafka服务器端代码,比如加入Kafka 1.0.0依赖: Maven <dependency> <grou ...
- &&和&、||和|的区别
&& 和 || 为短路与 短路或&&若前面的表达式为false,整个逻辑表达式为false,所以后面的表达式无论true和false都无法影响整个表达式的逻辑结果,所以 ...
- Go缓存DNS
Go里面的DNSclient没有带任何的缓存,语言层面没有任何的缓存,但是我们可以通过下面这样的代码来 这样当我们调用http.Client的时候就会采用这个缓存的ip了,里面用到的dnscache是 ...
- Spring mvc 下载文件处理
@RequestMapping(value = "downFile") public void downFile(HttpServletResponse response, Str ...
- go语言调度器源代码情景分析之一:开篇语
专题简介 本专题以精心设计的情景为线索,结合go语言最新1.12版源代码深入细致的分析了goroutine调度器实现原理. 适宜读者 go语言开发人员 对线程调度器工作原理感兴趣的工程师 对计算机底层 ...
- 死磕 java集合之PriorityBlockingQueue源码分析
问题 (1)PriorityBlockingQueue的实现方式? (2)PriorityBlockingQueue是否需要扩容? (3)PriorityBlockingQueue是怎么控制并发安全的 ...