/leetcode

My Solutions of LeetCode Problems (Language: Python, Golang)

Primary LanguagePython

Solutions of LeetCode Problems

This repo aims at arranging my solutions.
I solved these problems first. After that, I add other problems in this repo.

Hash Map

# Name Solution
1 Two Sum Python
Go
49 Group Anagrams Python
Go
349 Intersection of Two Arrays Python
387 First Unique Character in a String Python
560 Subarray Sum Equals K Python
929 Unique Email Addresses Python

LinkedList

# Name Solution
2 Add Two Numbers Python
Go
82 Remove Duplicates from Sorted List II Python
Go
83 Remove Duplicates from Sorted List Python
Go
141 Linked List Cycle Python
Go
142 Linked List Cycle II Python
Go

Sliding Window

# Name Solution
3 Longest Substring Without Repeating Characters Python
Go
209 Minimum Size Subarray Sum Python
Go

Greedy + Backtracking

# Name Solution
22 Generate Parentheses Python
Go
39 Combination Sum Python
Go
46 Permutations Python
Go
78 Subsets Python
Go

Stack

# Name Solution
20 Valid Parentheses Python
Go
206 Reverse Linked List Python
Go

Heap, PriorityQueue

# Name Solution
347 Top K Frequent Elements Python
373 Find K Pairs with Smallest Sums Python
703 Kth Largest Element in a Stream Python

Recursion

# Name Solution
50 Pow(x, n) Python
Go
779 K-th Symbol in Grammar Python

Binary Search

# Name Solution
33 Search in Rotated Sorted Array Python
Go
35 Search Insert Position Python
Go
153 Find Minimum in Rotated Sorted Array Python
Go
1011 Capacity To Ship Packages Within D Days Python

Graph, BFS, DFS

# Name Solution
127 Word Ladder
200 Number of Islands Python
Go
695 Max Area of Island Python

Tree, BT, BST

# Name Solution
94 Binary Tree Inorder Traversal
98 Validate Binary Search Tree Python
Go
101 Symmetric Tree
102 Binary Tree Level Order Traversal Python
Go
103 Binary Tree Zigzag Level Order Traversal Python
Go
104 Maximum Depth of Binary Tree Python Go
105 Construct Binary Tree from Preorder and Inorder Traversal Python
Go
108 Convert Sorted Array to Binary Search Tree Python
Go
111 Minimum Depth of Binary Tree Python
Go
112 Path Sum Python
Go
144 Binary Tree Preorder Traversal
145 Binary Tree Postorder Traversal
589 N-ary Tree Preorder Traversal
590 N-ary Tree Postorder Traversal
617 Merge Two Binary Trees Python

Dynamic Programming

# Name Solution
53 Maximum Subarray Python
Go
62 Unique Paths Python
Go
63 Unique Paths II Python
Go
121 Best Time to Buy and Sell Stock Python
Go
122 Best Time to Buy and Sell Stock II Python
Go
139 Word Break Python
Go
198 House Robber Python
Go
213 House Robber II Python
Go
300 Longest Increasing Subsequence Python
322 Coin Change Python

Others

# Name Solution
6 ZigZag Conversion Python
Go
8 String to Integer (atoi) python
31 Next Permutation Python
Go
283 Move Zeroes Python
392 Is Subsequence Python