Code Monkey home page Code Monkey logo

leetcode-solution's Introduction

LeetCode Solutions

Solution List

1 Two Sum
2 Add Two Numbers
3 Longest Substring Without Repeating Characters
4 Median of Two Sorted Arrays
5 Longest Palindromic Substring
6 ZigZag Conversion
7 Reverse Integer
8 String to Integer (atoi)
9 Palindrome Number
10 Regular Expression Matching
11 Container With Most Water
12 Integer to Roman
13 Roman to Integer
14 Longest Common Prefix
15 3Sum
16 3Sum Closest
17 Letter Combinations of a Phone Number
18 4Sum
19 Remove Nth Node From End of List
20 Valid Parentheses
21 Merge Two Sorted Lists
22 Generate Parentheses
23 Merge k Sorted Lists
24 Swap Nodes in Pairs
25 Reverse Nodes in k-Group
26 Remove Duplicates from Sorted Array
27 Remove Element
28 Implement strStr()
29 Divide Two Integers
30 Substring with Concatenation of All Words
31 Next Permutation
32 Longest Valid Parentheses
33 Search in Rotated Sorted Array
34 Search for a Range
35 Search Insert Position
36 Valid Sudoku
37 Sudoku Solver
38 Count and Say
39 Combination Sum
40 Combination Sum II
41 First Missing Positive
42 Trapping Rain Water
43 Multiply Strings
44 Wildcard Matching
45 Jump Game II
46 Permutations
47 Permutations II
48 Rotate Image
49 Anagrams
50 Pow(x, n)
51 N-Queens
52 N-Queens II
53 Maximum Subarray
54 Spiral Matrix
55 Jump Game
56 Merge Intervals
57 Insert Interval
58 Length of Last Word
59 Spiral Matrix II
60 Permutation Sequence
61 Rotate List
62 Unique Paths
63 Unique Paths II
64 Minimum Path Sum
65 Valid Number
66 Plus One
67 Add Binary
68 Text Justification
69 Sqrt(x)
70 Climbing Stairs
71 Simplify Path
72 Edit Distance
73 Set Matrix Zeroes
74 Search a 2D Matrix
75 Sort Colors
76 Minimum Window Substring
77 Combinations
78 Subsets
79 Word Search
80 Remove Duplicates from Sorted Array II
81 Search in Rotated Sorted Array II
82 Remove Duplicates from Sorted List II
83 Remove Duplicates from Sorted List
84 Largest Rectangle in Histogram
85 Maximal Rectangle
86 Partition List
87 Scramble String
88 Merge Sorted Array
89 Gray Code
90 Subsets II
91 Decode Ways
92 Reverse Linked List II
93 Restore IP Addresses
94 Binary Tree Inorder Traversal
95 Unique Binary Search Trees II
96 Unique Binary Search Trees
97 Interleaving String
98 Validate Binary Search Tree
99 Recover Binary Search Tree
100 Same Tree
101 Symmetric Tree
102 Binary Tree Level Order Traversal
103 Binary Tree Zigzag Level Order Traversal
104 Maximum Depth of Binary Tree
105 Construct Binary Tree from Preorder and Inorder Traversal
106 Construct Binary Tree from Inorder and Postorder Traversal
107 Binary Tree Level Order Traversal I
108 Convert Sorted Array to Binary Search Tree
109 Convert Sorted List to Binary Search Tree
110 Balanced Binary Tree
111 Minimum Depth of Binary Tree
112 Path Sum
113 Path Sum II
114 Flatten Binary Tree to Linked List
115 Distinct Subsequences
116 Populating Next Right Pointers in Each Node
117 Populating Next Right Pointers in Each Node II
118 Pascal's Triangle
119 Pascal's Triangle II
120 Triangle
121 Best Time to Buy and Sell Stock
122 Best Time to Buy and Sell Stock II
123 Best Time to Buy and Sell Stock III
124 Binary Tree Maximum Path Sum
125 Valid Palindrome
126 Word Ladder II
127 Word Ladder
128 Longest Consecutive Sequence
129 Sum Root to Leaf Numbers
130 Surrounded Regions
131 Palindrome Partitioning
132 Palindrome Partitioning II
133 Clone Graph
134 Gas Station
135 Candy
136 Single Number
137 Single Number II
138 Copy List with Random Pointer
139 Word Break
140 Word Break II
141 Linked List Cycle
142 Linked List Cycle II
143 Reorder List
144 Binary Tree Preorder Traversal
145 Binary Tree Postorder Traversal
146 LRU Cache
147 Insertion Sort List
148 Sort List
149 Max Points on a Line
150 Evaluate Reverse Polish Notation
151 Reverse Words in a String
152 Maximum Product Subarray
153 Find Minimum in Rotated Sorted Array
154 Find Minimum in Rotated Sorted Array II

Progress

DONE done
WIP work in progress
NIP not in-place
TODO to do
TLE time limit exceeded

Array

26 Remove Duplicates from Sorted Array DONE
27 Remove Element DONE
80 Remove Duplicates from Sorted Array II DONE

Backtracking

37 Sudoku Solver DONE
51 N-Queens DONE
52 N-Queens II DONE

Binary Search

4 Median of Two Sorted Arrays DONE
33 Search in Rotated Sorted Array DONE
34 Search for a Range DONE
35 Search Insert Position DONE
81 Search in Rotated Sorted Array II DONE
153 Find Minimum in Rotated Sorted Array DONE
154 Find Minimum in Rotated Sorted Array II DONE

Binary Tree

94 Binary Tree Inorder Traversal DONE
98 Validate Binary Search Tree DONE
100 Same Tree DONE
101 Symmetric Tree DONE
102 Binary Tree Level Order Traversal DONE
103 Binary Tree Zigzag Level Order Traversal DONE
104 Maximum Depth of Binary Tree DONE
107 Binary Tree Level Order Traversal II DONE
110 Balanced Binary Tree DONE
111 Minimum Depth of Binary Tree DONE
112 Path Sum DONE
113 Path Sum II DONE
114 Flatten Binary Tree to Linked List DONE
116 Populating Next Right Pointers in Each Node DONE
117 Populating Next Right Pointers in Each Node II NIP
124 Binary Tree Maximum Path Sum DONE
129 Sum Root to Leaf Numbers DONE
144 Binary Tree Preorder Traversal DONE
145 Binary Tree Postorder Traversal DONE

Bit

29 Divide Two Integers DONE
136 Single Number DONE

Combinatorics

17 Letter Combinations of a Phone Number DONE
22 Generate Parentheses DONE
31 Next Permutation DONE
39 Combination Sum DONE
40 Combination Sum II DONE
46 Permutations DONE
47 Permutations II DONE
60 Permutation Sequence DONE
62 Unique Paths DONE
63 Unique Paths II DONE
77 Combinations DONE
78 Subsets DONE
89 Gray Code DONE
90 Subsets II DONE
96 Unique Binary Search Trees DONE

Digit

7 Reverse Integer DONE
8 String to Integer (atoi) DONE
9 Palindrome Number DONE
12 Integer to Roman DONE
13 Roman to Integer DONE
38 Count and Say DONE
43 Multiply Strings DONE
50 Pow(x, n) DONE
66 Plus One DONE
67 Add Binary DONE

Dynamic Programming

45 Jump Game II DONE
53 Maximum Subarray DONE
55 Jump Game DONE
64 Minimum Path Sum DONE
70 Climbing Stairs DONE
72 Edit Distance DONE
85 Maximal Rectangle DONE
91 Decode Ways DONE
121 Best Time to Buy and Sell Stock DONE
122 Best Time to Buy and Sell Stock II DONE
123 Best Time to Buy and Sell Stock III DONE
131 Palindrome Partitioning DONE
132 Palindrome Partitioning II DONE
139 Word Break DONE
140 Word Break II DONE

Linked List

2 Add Two Numbers DONE
19 Remove Nth Node From End of List DONE
21 Merge Two Sorted Lists DONE
23 Merge k Sorted Lists DONE
24 Swap Nodes in Pairs NIP
25 Reverse Nodes in k-Group NIP

Matching

10 Regular Expression Matching TODO
28 Implement strStr() TODO
44 Wildcard Matching TODO

Stack

20 Valid Parentheses DONE
32 Longest Valid Parentheses DONE
71 Simplify Path DONE
84 Largest Rectangle in Histogram DONE
150 Evaluate Reverse Polish Notation DONE

Sum

1 Two Sum DONE
15 3Sum TLE
16 3Sum Closest TODO
18 4Sum DONE

Uncategorized

3 Longest Substring Without Repeating Characters DONE
6 ZigZag Conversion DONE
14 Longest Common Prefix DONE
36 Valid Sudoku DONE
41 First Missing Positive DONE
49 Anagrams DONE
54 Spiral Matrix DONE
56 Merge Intervals DONE
57 Insert Interval DONE
59 Spiral Matrix II DONE
75 Sort Colors DONE
76 Minimum Window Substring DONE
93 Restore IP Addresses DONE
115 Distinct Subsequences DONE
118 Pascal's Triangle DONE
119 Pascal's Triangle II DONE
120 Triangle DONE
125 Valid Palindrome DONE
126 Word Ladder II DONE
127 Word Ladder DONE
130 Surrounded Regions DONE
134 Gas Station DONE
135 Candy DONE
138 Copy List with Random Pointer DONE
141 Linked List Cycle DONE
142 Linked List Cycle II DONE

leetcode-solution's People

Contributors

bhuztez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.