/leetcode

Can I do BETTER?

Primary LanguageSwiftMIT LicenseMIT

Note

Please feel free to send Pull Request, Issue or give this repo a big Star, thank you!

My Leetcode Solutions

bold num means I DO NOT come up a solution by myself...

# Title Solution Difficulty
1 Two Sum Swift Easy
2 Add Two Numbers Swift Medium
14 Longest Common Prefix Java Easy
15 3Sum Swift, Python, Python Medium
19 Remove Nth Node From End of List Java, Swift Medium
20 Valid Parentheses Swift Easy
21 Merge Two Sorted Lists Swift Easy
22 Generate Parentheses Swift, Python Medium
23 Merge k Sorted Lists Python2 Hard
24 Swap Nodes in Pairs Swift Medium
25 Reverse Nodes in k-Group Swift Hard
27 Remove Element Swift Easy
28 Implement strStr() Swift Easy
33 Search in Rotated Sorted Array Swift Medium
36 Valid Sudoku Swift Medium
37 Sudoku Solver Swift Hard
50 Pow(x,n) Swift, Python Medium
51 N-Queens Swift,Swift, Python Hard
52 N-Queens II Swift Hard
54 Spiral Matrix Swift Medium
59 Spiral Matrix II Swift Medium
61 Rotate List Java Medium
66 Plus One Swift Easy
67 Add Binary Swift Easy
69 Sqrt(x) Swift, Swift Easy
70 Climbing Stairs Swift, Swift Easy
72 Edit Distance Swift Hard
79 Word Search Swift Medium
81 Search in Rotated Sorted Array II Swift Medium
82 Remove Duplicates from Sorted List II Swift Medium
98 Validate Binary Search Tree Swift, Python Medium
100 Same Tree Swift Easy
102 Binary Tree Level Order Traversal Swift, Python, Python Medium
104 Maximum Depth of Binary Tree Swift Easy
105 Construct Binary Tree from Preorder and Inorder Traversal Swift Medium
111 Minimum Depth of Binary Tree Swift Easy
118 Pascal's Triangle Swift Easy
119 Pascal's Triangle II Swift Easy
120 Triangle Swift Medium
121 Best Time to Buy and Sell Stock Swift Easy
122 Best Time to Buy and Sell Stock II Swift, Swift Easy
123 Best Time to Buy and Sell Stock III Swift, Swift, Python Hard
138 Copy List with Random Pointer Java Medium
141 Linked List Cycle Java, Swift Easy
142 Linked List Cycle II Java, Swift Medium
146 LRU Cache Swift Medium
148 Sort List Swift Medium
152 Maximum Product Subarray Swift, Swift, Python, Python Medium
153 Find Minimum in Rotated Sorted Array Swift Medium
160 Intersection of Two Linked Lists Java Easy
167 Two Sum II - input array is sorted Swift Easy
169 Majority Element Swift Easy
189 Rotate Array Swift Easy
191 Number of 1 Bits Java, Swift Easy
200 Number of Islands Swift Medium
203 Remove Linked List Element Java Easy
206 Reverse Linked List Java, Swift, Swift Easy
208 Implement Trie (Prefix Tree) Swift Medium
212 Word Search II Swift Hard
215 Kth Largest Element in an Array Swift Medium
224 Basic Calculator Swift Hard
225 Implement Stack using Queue Swift Easy
230 Kth Smallest Element in a BST Swift Medium
231 Power of Two Swift Easy
232 Implement Queue using Stacks Swift Easy
234 Palindrome Linked List Java Easy
235 Lowest Common Ancestor of a Binary Search Tree Swift, Java Easy
236 Lowest Common Ancestor of a Binary Tree Swift, Java Medium
238 Product of Array Except Self Swift Medium
239 Sliding Window Maximum Swift, Swift,Swift Hard
242 Valid Anagram Swift, Swift, Easy
283 Move Zeroes Swift Easy
295 Find Median from Data Stream Swift Hard
300 Longest Increasing Subsequence Swift, Swift Medium
322 Coin Change Swift Medium
328 Odd Even Linked List Java Medium
338 Counting Bits Swift Medium
344 Reverse String Swift Easy
367 Valid Perfect Square Swift Easy
373 Find K Pairs with Smallest Sums Swift Medium
402 Remove K Digits Swift Medium
430 Flatten a Multilevel Doubly Linked List Java Medium
450 Delete Node in a BST Swift Medium
451 Sort Characters By Frequency Swift Medium
456 132 Pattern Swift Medium
498 Diagonal Traverse Swift Medium
547 Friend Circles Swift Medium
561 Array Partition I Swift Easy
621 Task Scheduler Swift Medium
622 Design Circular Queue Swift Medium
697 Degree of an Array Swift Easy
700 Search in a Binary Search Tree Swift Easy
701 Insert into a Binary Search Tree Swift Medium
703 Kth Largest Element in a Stream Swift Easy
707 Design Linked List Java Easy
708 Insert into a Cyclic Sorted List Java Medium
724 Find Pivot Index Swift Easy
747 Largest Number At Least Twice of Others Swift Easy
785 Is Graph Bipartite? Swift Medium
849 Maximize Distance to Closest Person Swift Easy
871 Minimum Number of Refueling Stops Swift Hard
938 Range Sum of BST Swift Easy
946 Validate Stack Sequences Swift Medium
997 Find the Town Judge Swift Easy

Algorithms

Algorithms

Other Swift Algorithms Repo

Leetcode

Blogs

Courses