/leetcode

leetcode for js 110 / 385

Primary LanguageHTML

This is leetcode solution with js.

I have done some explaination for some leetcode problems.

You can visit https://qiuyuntao.github.io/leetcode to see these explainations.

problems explaination source
1. Two Sum view explaination [view source](./js/1. Two Sum.js)
2. Add Two Numbers view explaination [view source](./js/2. Add Two Numbers.js)
3. Longest Substring Without Repeating Characters view explaination [view source](./js/3. Longest Substring Without Repeating Characters.js)
4. Median of Two Sorted Arrays view explaination [view source](./js/4. Median of Two Sorted Arrays.js)
7. Reverse Integer view explaination [view source](./js/7. Reverse Integer.js)
8. String to Integer (atoi) view explaination [view source](./js/8. String to Integer (atoi).js)
9. Palindrome Number view explaination [view source](./js/9. Palindrome Number.js)
12. Integer to Roman view explaination [view source](./js/12. Integer to Roman.js)
13. Roman to Integer view explaination [view source](./js/13. Roman to Integer.js)
15. 3Sum view explaination [view source](./js/15. 3Sum.js)
16. 3Sum Closest view explaination [view source](./js/16. 3Sum Closest.js)
17. Letter Combinations of a Phone Number view explaination [view source](./js/17. Letter Combinations of a Phone Number.js)
18. 4Sum view explaination [view source](./js/18. 4Sum.js)
19. Remove Nth Node From End of List view explaination [view source](./js/19. Remove Nth Node From End of List.js)
20. Valid Parentheses view explaination [view source](./js/20. Valid Parentheses.js)
21. Merge Two Sorted Lists view explaination [view source](./js/21. Merge Two Sorted Lists.js)
24. Swap Nodes in Pairs view explaination [view source](./js/24. Swap Nodes in Pairs.js)
25. Reverse Nodes in k-Group view explaination [view source](./js/25. Reverse Nodes in k-Group.js)
26. Remove Duplicates from Sorted Array view explaination [view source](./js/26. Remove Duplicates from Sorted Array.js)
27. Remove Element view explaination [view source](./js/27. Remove Element.js)
28. Implement strStr() view explaination [view source](./js/28. Implement strStr().js)
34. Search for a Range view explaination [view source](./js/34. Search for a Range.js)
35. Search Insert Position view explaination [view source](./js/35. Search Insert Position.js)
46. Permutations view explaination [view source](./js/46. Permutations.js)
49. Group Anagrams view explaination [view source](./js/49. Group Anagrams.js)
58. Length of Last Word view explaination [view source](./js/58. Length of Last Word.js)
61. Rotate List view explaination [view source](./js/61. Rotate List.js)
65. Valid Number view explaination [view source](./js/65. Valid Number.js)
67. Add Binary view explaination [view source](./js/67. Add Binary.js)
70. Climbing Stairs view explaination [view source](./js/70. Climbing Stairs.js)
71. Simplify Path view explaination [view source](./js/71. Simplify Path.js)
78. Subsets view explaination [view source](./js/78. Subsets.js)
80. Remove Duplicates from Sorted Array II view explaination [view source](./js/80. Remove Duplicates from Sorted Array II.js)
82. Remove Duplicates from Sorted List II view explaination [view source](./js/82. Remove Duplicates from Sorted List II.js)
83. Remove Duplicates from Sorted List view explaination [view source](./js/83. Remove Duplicates from Sorted List.js)
86. Partition List view explaination [view source](./js/86. Partition List.js)
88. Merge Sorted Array view explaination [view source](./js/88. Merge Sorted Array.js)
90. Subsets II view explaination [view source](./js/90. Subsets II.js)
92. Reverse Linked List II view explaination [view source](./js/92. Reverse Linked List II.js)
94. Binary Tree Inorder Traversal view explaination [view source](./js/94. Binary Tree Inorder Traversal.js)
100. Same Tree view explaination [view source](./js/100. Same Tree.js)
102. Binary Tree Level Order Traversal view explaination [view source](./js/102. Binary Tree Level Order Traversal.js)
104. Maximum Depth of Binary Tree view explaination [view source](./js/104. Maximum Depth of Binary Tree.js)
107. Binary Tree Level Order Traversal II view explaination [view source](./js/107. Binary Tree Level Order Traversal II.js)
111. Minimum Depth of Binary Tree view explaination [view source](./js/111. Minimum Depth of Binary Tree.js)
112. Path Sum view explaination [view source](./js/112. Path Sum.js)
113. Path Sum II view explaination [view source](./js/113. Path Sum II.js)
114. Flatten Binary Tree to Linked List view explaination [view source](./js/114. Flatten Binary Tree to Linked List.js)
118. Pascal's Triangle view explaination [view source](./js/118. Pascal's Triangle.js)
119. Pascal's Triangle II view explaination [view source](./js/119. Pascal's Triangle II.js)
125. Valid Palindrome view explaination [view source](./js/125. Valid Palindrome.js)
129. Sum Root to Leaf Numbers view explaination [view source](./js/129. Sum Root to Leaf Numbers.js)
137. Single Number II view explaination [view source](./js/137. Single Number II.js)
141. Linked List Cycle view explaination [view source](./js/141. Linked List Cycle.js)
142. Linked List Cycle II view explaination [view source](./js/142. Linked List Cycle II.js)
144. Binary Tree Preorder Traversal view explaination [view source](./js/144. Binary Tree Preorder Traversal.js)
151. Reverse Words in a String view explaination [view source](./js/151. Reverse Words in a String.js)
160. Intersection of Two Linked Lists view explaination [view source](./js/160. Intersection of Two Linked Lists.js)
168. Excel Sheet Column Title view explaination [view source](./js/168. Excel Sheet Column Title.js)
169. Majority Element view explaination [view source](./js/169. Majority Element.js)
171. Excel Sheet Column Number view explaination [view source](./js/171. Excel Sheet Column Number.js)
189. Rotate Array view explaination [view source](./js/189. Rotate Array.js)
190. Reverse Bits view explaination [view source](./js/190. Reverse Bits.js)
191. Number of 1 Bits view explaination [view source](./js/191. Number of 1 Bits.js)
199. Binary Tree Right Side View view explaination [view source](./js/199. Binary Tree Right Side View.js)
202. Happy Number view explaination [view source](./js/202. Happy Number.js)
203. Remove Linked List Elements view explaination [view source](./js/203. Remove Linked List Elements.js)
205. Isomorphic Strings view explaination [view source](./js/205. Isomorphic Strings.js)
206. Reverse Linked List view explaination [view source](./js/206. Reverse Linked List.js)
215. Kth Largest Element in an Array view explaination [view source](./js/215. Kth Largest Element in an Array.js)
217. Contains Duplicate view explaination [view source](./js/217. Contains Duplicate.js)
219. Contains Duplicate II view explaination [view source](./js/219. Contains Duplicate II.js)
222. Count Complete Tree Nodes view explaination [view source](./js/222. Count Complete Tree Nodes.js)
223. Rectangle Area.htm view explaination [view source](./js/223. Rectangle Area.htm.js)
223. Rectangle Area view explaination [view source](./js/223. Rectangle Area.js)
224. Basic Calculator view explaination [view source](./js/224. Basic Calculator.js)
225. Implement Stack using Queues view explaination [view source](./js/225. Implement Stack using Queues.js)
226. Invert Binary Tree view explaination [view source](./js/226. Invert Binary Tree.js)
227. Basic Calculator II view explaination [view source](./js/227. Basic Calculator II.js)
228. Summary Ranges view explaination [view source](./js/228. Summary Ranges.js)
229. Majority Element II view explaination [view source](./js/229. Majority Element II.js)
230. Kth Smallest Element in a BST view explaination [view source](./js/230. Kth Smallest Element in a BST.js)
231. Power of Two view explaination [view source](./js/231. Power of Two.js)
232. Implement Queue using Stacks view explaination [view source](./js/232. Implement Queue using Stacks.js)
234. Palindrome Linked List view explaination [view source](./js/234. Palindrome Linked List.js)
237. Delete Node in a Linked List view explaination [view source](./js/237. Delete Node in a Linked List.js)
238. Product of Array Except Self view explaination [view source](./js/238. Product of Array Except Self.js)
242. Valid Anagram view explaination [view source](./js/242. Valid Anagram.js)
257. Binary Tree Paths view explaination [view source](./js/257. Binary Tree Paths.js)
258. Add Digits view explaination [view source](./js/258. Add Digits.js)
263. Ugly Number view explaination [view source](./js/263. Ugly Number.js)
268. Missing Number view explaination [view source](./js/268. Missing Number.js)
283. Move Zeroes view explaination [view source](./js/283. Move Zeroes.js)
287. Find the Duplicate Number view explaination [view source](./js/287. Find the Duplicate Number.js)
290. Word Pattern view explaination [view source](./js/290. Word Pattern.js)
292. Nim Game view explaination [view source](./js/292. Nim Game.js)
303. Range Sum Query - Immutable view explaination [view source](./js/303. Range Sum Query - Immutable.js)
304. Range Sum Query 2D - Immutable view explaination [view source](./js/304. Range Sum Query 2D - Immutable.js)
312. Burst Balloons view explaination [view source](./js/312. Burst Balloons.js)
315. Count of Smaller Numbers After Self view explaination [view source](./js/315. Count of Smaller Numbers After Self.js)
318. Maximum Product of Word Lengths view explaination [view source](./js/318. Maximum Product of Word Lengths.js)
319. Bulb Switcher view explaination [view source](./js/319. Bulb Switcher.js)
326. Power of Three view explaination [view source](./js/326. Power of Three.js)
328. Odd Even Linked List view explaination [view source](./js/328. Odd Even Linked List.js)
338. Counting Bits view explaination [view source](./js/338. Counting Bits.js)
342. Power of Four view explaination [view source](./js/342. Power of Four.js)
343. Integer Break view explaination [view source](./js/343. Integer Break.js)
344. Reverse String view explaination [view source](./js/344. Reverse String.js)
345. Reverse Vowels of a String view explaination [view source](./js/345. Reverse Vowels of a String.js)
347. Top K Frequent Elements view explaination [view source](./js/347. Top K Frequent Elements.js)
349. Intersection of Two Arrays view explaination [view source](./js/349. Intersection of Two Arrays.js)
350. Intersection of Two Arrays II view explaination [view source](./js/350. Intersection of Two Arrays II.js)
357. Count Numbers with Unique Digits view explaination [view source](./js/357. Count Numbers with Unique Digits.js)
367. Valid Perfect Square view explaination [view source](./js/367. Valid Perfect Square.js)
373. Find K Pairs with Smallest Sums view explaination [view source](./js/373. Find K Pairs with Smallest Sums.js)
378. Kth Smallest Element in a Sorted Matrix view explaination [view source](./js/378. Kth Smallest Element in a Sorted Matrix.js)
412. Fizz Buzz view explaination [view source](./js/412. Fizz Buzz.js)