Repository files navigation
This is a Repository where I record my solutions to LeetCode Problems I will periodically update the README to keep the categories up-to-date Life is not a race, but there's no speed limit either :) Have FUN Arrays Binary Search Breadth First Search Depth First Search Graph Heap Linked Lists Math Recursion Stack Strings Trees Queue # Title Time Space Difficulty Notes Tags 1 Two Sum O(n) O(n) Easy - Array, HashMap 2 Add Two Numbers O(n) O(1) Medium - LinkedList 3 Longest Substring Without Repeating Characters O(n) O(size(char_set)) Medium - HashMap 4 Median of Two Sorted Arrays O(log(min(m,n))) O(1) Hard R Math, BinarySearch 5 Longest Palindromic Substring O(n^2) O(1) Medium - DP, Array 6 ZigZag Conversion O(n) O(n) Medium - String 7 Reverse Integer O(logn (base10)) O(1) Easy - Math 8 String to Integer O(n) O(n) Medium - Math, String 9 Palindrome Number O(logn (base10)) O(1) Easy - Math 10 Regular Expression Matching 11 Container With Most Water O(n) O(1) Medium - Array, Two Pointers 12 Integer to Roman O(n) O(n) Medium ordered processing Math, String 13 Roman to Integer O(n) O(1) Easy clean up Math, String 14 Longest Common Prefix O(n*len(lcp)) O(lcp) Easy - String 15 3Sum O(n^2) O(1) Medium - Two Pointers, Arrays 16 3Sum Closest O(n^2) O(1) Medium - Two Pointers, Arrays 17 Letter Combinations of a Phone Number O(~3^n) O(~3^n) Medium - Backtracking 18 4Sum O(n^3) O(1) Medium - Two Pointers 19 Remove Nth Node From End of List O(n) O(1) Medium - Two Pointers, LinkedList 20 Valid Parentheses O(n) O(n) Easy - String, Stack 21 Merge Two Sorted Lists O(m+n) O(1) Easy - LinkedList 22 Generate Parentheses O(Catalan Number) O(1)excluding op Medium - String, Backtracking 23 Merge k Sorted Lists O(nlogk) O(k) Hard Try constant space approach LinkedList, Heap, Divide and Conquer 24 Swap Nodes in Pairs O(n) O(1) Medium - LinkedList 25 Reverse Nodes in k-Group 26 Remove Duplicates from Sorted Array O(n) O(1) Easy in-place Two Pointers, Arrays 27 Remove Element O(n) O(1) Easy in-place Two Pointers, Arrays 28 Implement strStr() Easy using KMP Two Pointers, String 29 Divide Two Integers O(log(dividend)) O(1) Medium - Binary Search, Math 30 Substring with Concatenation of All Words Hard HashMap, Two Pointers, String Check out the Python directory for more...
You can’t perform that action at this time.