answers for algorithm-questions from Leetcode in Javascript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.DS_Store
1. Two Sum.js
102. Binary Tree Level Order Traversal.js
103. Binary Tree Zigzag Level Order Traversal.js
104. Maximum Depth Of Binary Tree.js
110. Balanced Binary Tree.js
113. Path Sum II.js
114. Flatten Binary Tree to Linked List.js
116. Populating Next Right Pointers in Each Node.js
117. Populating Next Right Pointers in Each Node I.js
121. Best Time to Buy and Sell Stock.js
122. Best Time to Buy and Sell Stock II.js
123. Best Time to Buy and Sell Stock III.js
124. binary-tree-maximum-path-sum.js
127. Word Ladder.js
131. Palindrome Partitioning.js
133. Clone Graph.js
138. Copy List with Random Pointer.js
139. Word Break.js
14. Longest Common Prefix.js
141. Linked List Cycle.js
142. Linked List Cycle II.js
146. LRU Cache.js
148. Sort List.js
15. 3Sum.js
155. Min Stack.js
159. Longest Substring with At Most Two Distinct C.js
16. 3Sum Closest.js
160. Intersection of Two Linked Lists.js
162. Find Peak Element.js
163. Missing Ranges.js
167. Two Sum II - Input array is sorted.js
170. Two Sum III - Data structure design.js
173. Binary Search Tree Iterator.js
2. Add Two Numbers.js
200. Number of Islands.js
206. Reverse Linked List.js
207. Course Schedule.js
21. Merge Two Sorted Lists.js
210. Course Schedule II.js
215. Kth Largest Element in an Array.js
23. Merge k Sorted Lists.js
230. Kth Smallest Element in a BST.js
231. Power of Two.js
232. Implement Queue using Stacks.js
236. Lowest Common Ancestor of a Binary Tree.js
237. Delete Node in a Linked List.js
240. Search a 2D Matrix II.js
246. Strobogrammatic Number.js
247. Strobogrammatic Number II.js
257. Binary Tree Paths.js
259. 3Sum Smaller.js
261. Graph Valid Tree.js
263. Ugly Number.js
264. Ugly Number II.js
266. Palindrome Permutation.js
268. Missing Number.js
270. Closest Binary Search Tree Value.js
271. Encode and Decode Strings.js
276. Paint Fence.js
278. First Bad Version.js
279. Perfect Squares.js
280. Wiggle Sort.js
281. Zigzag Iterator.js
283. Move Zeroes.js
287. Find the Duplicate Number.js
288. Unique Word Abbreviation.js
289. Game of Life.js
293. Flip Game.js
294. Flip Game II.js
297. Serialize and Deserialize Binary Tree.js
298. Binary Tree Longest Consecutive Sequence.js
304. Range Sum Query 2D - Immutable.js
305. Number of Islands II.js
308. Range Sum Query 2D - Mutable.JS
310. Minimum Height Trees.js
313. Super Ugly Number.js
314. Binary Tree Vertical Order Traversal.js
317. Shortest Distance from All Buildings.js
324. Wiggle Sort II.js
326. Power of Three.js
331. Verify Preorder Serialization of a Binary Tre.js
339. Nested List Weight Sum.js
340. Longest Substring with At Most K Distinct Cha.js
341. Flatten Nested List Iterator.js
344. Reverse String.js
345. Reverse Vowels of a String.js
346. Moving Average from Data Stream.js
351. Android Unlock Patterns.js
359. Logger Rate Limiter.js
361. Bomb Enemy.js
364. Nested List Weight Sum II.js
370. Range Addition.js
374. Guess Number Higher or Lower.js
377. Combination Sum IV.js
378. Kth Smallest Element in a Sorted Matrix.js
380. Insert Delete GetRandom O(1).js
381. Insert Delete GetRandom O(1) - Duplicates all.js
387. First Unique Character in a String.js
388. Longest Absolute File Path.js
389. Find the Difference.js
39. Combination Sum.js
393. UTF-8 Validation.js
394. Decode String.js
399. Evaluate Division.js
4. Median of Two Sorted Arrays.js
400. Nth Digit.js
401. Binary Watch.js
406. Queue Reconstruction by Height.js
408. Valid Word Abbreviation.js
409. Longest Palindrome.js
415. Add Strings.js
418. Sentence Screen Fitting.js
42. Trapping Rain Water.js
421. Maximum XOR of Two Numbers in an Array.js
422. Valid Word Square.js
445. Add Two Numbers II.js
447. Number of Boomerangs.js
448. Find All Numbers Disappeared in an Array.js
451. Sort Characters By Frequency.js
459. Repeated Substring Pattern.js
463. Island Perimeter.js
475. Heaters.js
481. Magical String.js
482. License Key Formatting.js
484. Find Permutation.js
485. Max Consecutive Ones.js
487. Max Consecutive Ones II.js
490. The Maze.js
494. Target Sum.js
496. Next Greater Element I.js
498. Diagonal Traverse.js
50. Pow(x, n).js
501. Find Mode in Binary Search Tree.js
503. Next Greater Element II.js
505. The Maze II.js
506. Relative Ranks.js
520. Detect Capital.js
524. Longest Word in Dictionary through Deleting.js
526. Beautiful Arrangement.js
527. Word Abbreviation.js
53. Maximum Subarray.js
530. Minimum Absolute Difference in BST.js
531. Lonely Pixel I.js
533. Lonely Pixel II.js
535. Encode and Decode TinyURL.js
541. Reverse String II.js
542. 01 Matrix.js
543. Diameter of Binary Tree.js
544. Output Contest Matches.js
545. Boundary of Binary Tree.js
56. Merge Intervals.js
62. Unique Paths.js
63. Unique Paths II.js
66. Plus One.js
74. Search a 2D Matrix.js
75. Sort Colors.js
92. Reverse Linked List II.js
94. Binary Tree Inorder Traversal.js
98. Validate Binary Search Tree.js
Clarify questions.js
High Five.js
K Closest Points.js
Kth Largest Element II.js
Minimum Subtree.js
Partition Array.js
README.md
Remove Duplicate Numbers in Array.js
Sort Colors II.js
Sort Colors.js
Subtree with Maximum Average.js
Top k Largest Numbers.js
Two Sum Closest.js
Two Sum VI - Unique two sum pairs.js
Two Sum VII - Difference equals to target.js
binary-tree-preorder-traversal.js
find-minimum-in-rotated-sorted-array.js
map.js
permutation.js
permutation2.js
reduce-js.js
search-in-rotate-sorted-array.js
sqrt(x).js
strStr.js
subsets.js
subsets2.js

README.md

algorithm-questions

Answers for algorithm-questions from Leetcode in Javascript.

    1. Magical String
    1. Find Permutation
    1. Sort Characters By Frequency
    1. Maximum XOR of Two Numbers in an Array
    1. Diagonal Traverse
    1. Next Greater Element II
    1. Next Greater Element I
    1. Boundary of Binary Tree
    1. Longest Word in Dictionary through Deleting
    1. Beautiful Arrangement
    1. Word Abbreviation
    1. 01 Matrix
    1. Lonely Pixel I
    1. Lonely Pixel II
    1. Output Contest Matches
    1. The Maze II
    1. The Maze
    1. Minimum Height Trees
    1. Serialize and Deserialize Binary Tree
    1. Range Sum Query 2D - Immutable
    1. Binary Tree Vertical Order Traversal
    1. Pow(x, n)
    1. Binary Tree Inorder Traversal
    1. Kth Smallest Element in a BST
    1. Verify Preorder Serialization of a Binary Tree
    1. Verify Preorder Serialization of a Binary Tree
    1. Kth Smallest Element in a Sorted Matrix
    1. Evaluate Division
    1. Encode and Decode TinyURL
    1. Insert Delete GetRandom O(1) - Duplicates allowed
    1. Insert Delete GetRandom O(1)
    1. Range Addition
    1. Super Ugly Number
    1. Combination Sum IV
    1. Target Sum
    1. Perfect Squares
    1. Queue Reconstruction by Height
    1. Game of Life
    1. 3Sum Smaller
    1. Wiggle Sort II
    1. Wiggle Sort
    1. Android Unlock Patterns
    1. Relative Ranks
    1. Detect Capital
    1. Reverse String II
    1. Find Mode in Binary Search Tree
    1. Minimum Absolute Difference in BST
    1. Heaters
    1. Find All Numbers Disappeared in an Array
    1. Number of Boomerangs
    1. Max Consecutive Ones II
    1. Max Consecutive Ones
    1. Power of Three
    1. Guess Number Higher or Lower
    1. Repeated Substring Pattern
    1. Valid Word Abbreviation
    1. Power of Two
    1. Valid Word Square
    1. Longest Palindrome
    1. Closest Binary Search Tree Value
    1. Island Perimeter
    1. Missing Number
    1. Nth Digit
    1. Paint Fence
    1. Binary Watch
    1. Find the Difference
    1. Flip Game II
    1. Flip Game
    1. Logger Rate Limiter
    1. Strobogrammatic Number II
    1. Strobogrammatic Number
    1. Reverse Vowels of a String
    1. Reverse String
    1. Add Strings
    1. Longest Common Prefix
    1. Number of Islands II
    1. Linked List Cycle II
    1. Ugly Number II
    1. Ugly Number
    1. Merge k Sorted Lists
  • Rehashing
    1. Flatten Nested List Iterator
  • Top k Largest Numbers
    1. Implement Queue using Stacks
    1. Kth Largest Element in an Array
  • Kth Largest Element II
  • K Closest Points
  • High Five
    1. Nested List Weight Sum II
    1. Nested List Weight Sum
    1. Find the Duplicate Number
  • Remove Duplicate Numbers in Array
    1. 3Sum Closest
    1. 3Sum
  • Sort Colors II
    1. Sort Colors
    1. Binary Tree Zigzag Level Order Traversal
    1. Binary Search Tree Iterator
    1. Unique Word Abbreviation
    1. Encode and Decode Strings
    1. Plus One
    1. Decode String
    1. Missing Ranges
    1. Moving Average from Data Stream
    1. Bomb Enemy
    1. Zigzag Iterator
    1. Sentence Screen Fitting
    1. Range Sum Query 2D - Mutable
    1. Longest Substring with At Most Two Distinct Characters
    1. License Key Formatting
    1. Longest Absolute File Path
  • Sort Colors
  • Partition Array
    1. Two Sum II - Input array is sorted
  • Two Sum Closest
  • Two Sum VII - Difference equals to target
    1. Two Sum III - Data structure design
    1. Median of Two Sorted Arrays
    1. Sort List
    1. Linked List Cycle
    1. Merge Two Sorted Lists
    1. Word Ladder
    1. Word Break
    1. Palindrome Permutation
    1. Combination Sum
    1. Palindrome Partitioning
    1. Shortest Distance from All Buildings
    1. Clone Graph
    1. Graph Valid Tree
    1. Course Schedule II
    1. Course Schedule
    1. Validate Binary Search Tree
    1. Lowest Common Ancestor of a Binary Tree
    1. Binary Tree Paths
    1. Path Sum II
    1. LRU Cache
    1. Reverse Linked List II
    1. Reverse Linked List
    1. Populating Next Right Pointers in Each Node II
    1. Populating Next Right Pointers in Each Node
    1. Trapping Rain Water
    1. Unique Paths II
    1. Unique Paths
    1. Min Stack
    1. Move Zeroes
    1. Copy List with Random Pointer
    1. Best Time to Buy and Sell Stock
    1. Best Time to Buy and Sell Stock II
    1. Best Time to Buy and Sell Stock III
    1. Maximum Subarray
    1. Add Two Numbers II
    1. Add Two Numbers
    1. Merge Intervals
    1. Search a 2D Matrix II
    1. Search a 2D Matrix
    1. Flatten Binary Tree to Linked List
    1. Intersection of Two Linked Lists
    1. Delete Node in a Linked List
    1. Binary Tree Level Order Traversal
    1. Binary Tree Longest Consecutive Sequence
  • Minimum Subtree
  • Binary Tree Longest Consecutive Sequence
    1. Two Sum
    1. Binary Tree Maximum Path Sum
    1. Binary Tree Preorder Traversal
    1. Balanced Binary Tree
    1. Maximum Depth of Binary Tree
    1. Search in Rotated Sorted Array
    1. First Bad Version
    1. Find Peak Element
    1. Find Minimum in Rotated Sorted Array
    1. Sqrt(x)
    1. Permutations II
    1. Permutations
    1. Subsets II
    1. Subsets
    1. Implement strStr()