So this is just a repo, I store my solutions for problems from leetcode.com
.
0098 Validate Binary Search Tree
- Java Recursive
- Java Iterative
- Java Inorder
0099 Recover Binary Search Tree
- Java Recursive
0101 Symmetric tree
- Java Recursive
- Java Iterative
- C Recursive
- Python Iterative
0102 Binary Tree Level Order Traversal
- Python3 iterative
0103 Binary Tree Zigzag Level Order Traversal
- Python3 iterative BFS w Deques
0104 Maximum depth of binary tree
- Java Iterative
- Java Recursive
- C Recursive
- Python Iterative
0105 Construct Binary Tree from Preorder and Inorder Traversal
- Python3 recursive
0106 Construct Binary Tree from Inorder and Postorder Traversal
- Python3 Recursive
0109 Convert Sorted List to Binary Search Tree
- Recursive Python3
0110 Balanced Binary Tree
- Java Recursive
- C Recursive
0111 Minimum Depth of Binary Tree
- Java Recursive
- Java Iterative
- C Recursive
0112 Path Sum
- Java Iteration
- Java Recursive
- C Recursive Backtracking
0113 Path Sum II
- Java Recursive Backtracking
0116 Populating Next Right Pointers in Each Node
- Java Queues
- Java Two Ptrs
0117 Populating Next Right Pointers in Each Node II
- Java Queues
- Java Two Ptrs
0124 Binary Tree Maximum path Sum
- Java Recursion
0226 Invert Binary Tree
- Java Recursive
- Java Iterative
0450 Delete Node in BST
- Java Recursive
0545 Boundary of Binary Tree
- Java Iterative / Recursive
0559 Maximum Depth of N-ary Tree
- Java Iterative
- Java Recursive
0700 Search in a Binary Search Tree
- Java Recursion
- Java Iterative
0701 Insert into a Binary Search Tree
- Java Recursive
0938 Range Sum of BST
- Java Recursive
- Java Iterative
1469 Find All The Lonely Nodes
- Java Recursive
0133 Clone Graph
- Java DFS
0001 Two Sum
- Java hashmap 1-pass
0002 Add Two Numbers
- Java Iterative
0007 Integer Reversal
- Java Digit Iteration
- Java String/Int Conversion
0009 Integer Palindrome
- Java Palindrome Check
- Java Integer Reversal
- Java Half Integer Reversal
0015 Three Sum
- Java hashmap
0045 Jump Game II
- Java Iteration
- Java Greedy
0066 Plus One
- Java Array Iteration
- Java Array Iteration Improved
0136 Single Number
- Java HashSet
- Java Xorin
0137 Single Number II
- Python3 Hashmap
- Python3 Xor/And/Not Solution
0179 Largest Number
- Java String Conversion / Comparison
0190 Java Bit Reversal
- Java Bit Reversal
0191 Number of 1 Bits
- Java Bit Iteration
- Java Anding Bit Manipulation
0258 Add Digits
- Java Digit Sumnations
- Java Mathematical Digital Root
0273 Integer to English Words
- Java Conversion
0295 Find Median from Data Stream
- Java Sorting
0412 Fizz Buzz
- Java Modding Iteration
0461 Hamming Distance
- Java Bit Anding
0476 Number Complement
- Java Bit Iteration
0868 Binary Gap
- Java Binary Anding
1133 Largest Unique Number
- Java Hashmap
1304 Find N Unique Integers Sum up to Zero
- Java Summation
0003 Longest Substring Without Repeating Characters
- Java Sliding Window
- Java Sliding Window Optimized
0005 Longest Palindromic Substring
- Java Center Iteration
0008 atoi implementation
- Java Iterative Ascii Math
0014 Longest Common prefix
- Java String Iteration
0017 Letter Combinations of a Phone Number
- Java Combination Construction
- Java Recursive Branching
0020 Valid Parenthesis
- Java Stack
- Java Stack Improved
0043 Multiply Strings
- Java "By Hand"
0044 Wildcard Matching
- Java Backtracking
0125 Valid Palindrome
- Java Two Indices
0139 Word Break
- Java Depth First Search w/ memorization
0151 Reverse Words in String
- Java Iterate through String
- Java Simple Solution
0205 Isomorphic Strings
- Java HashMaps and Array
0214 Shortest Palindrome
- Java Iterative
- Java Recursive
0228 Summary Ranges
- Java Iteration
0242 Valid Anagram
- Java Sorting
0340 Longest Substring with At Most K Distinct Characters
- Java Sliding Window HashMap
0387 First Unique Character in a String
- Java Linear Pass Hashmap
0392 Is Subsquence
- Java Queue
0415 Add Strings
- Java Iterative String Concatenation
- Java Iterative StringBuilder
0443 String Compression
- Java Single Pass
- Java Two Indices
0468 Validate IP Address
- Python3 String Parsing
0557 Reverse Words in a String III
- Java String Iteration w StringBuilder
0680 Valid Palindrom II
- Java String Iteration
0692 Top K Frequent Words
- Java HashMap and MinHeap PriorityQueue
0722 Remove Comments
- Java String Iteration
0844 Backspace String Compare
- Java StringBuilder
- Java Two Indices
1044 Longest Duplicate Substring
- Java Hashmap
- Java Binary Search / Rolling Hash
1108 Defang IP
- Python3 split / join
1119 Remove Vowels from a String
- Java String iteration
1160 Find Words That Can Be Formed by Characters
- Java Hashmaps
1239 Maximum Length of a Concatenated String with Unique Characters
- Java Recursion
1614 Maximum Nesting Depth of the Parentheses
- Java Iteration
0048 Rotate Image
- Java Matrix Transpose / Row Reversal
0054 Spiral Matrix
- Java Grid iteration
0062 Unique Paths
- Java Dynamic Programming
0063 Unique Paths II
- Java Dynamic Programming
0073 Set Matrix Zeroes
- Java Iterative Queue
0074 Grids
- Double Binary Search
0079 Word Search
- Java Backtracking Depth-First Search
0085 Maximum Rectangle
- Java Dynammic Programming
0200 Number of Islands
- Java Depth First Search
- Java Breadth First Search
0239 Sliding Window Maximum
- Java Iterative Slide Window
0240 Search a 2D Matrix II
- Java Linear Search Recursion w/ Memorization
0329 Longest Increasing Path in a Matrix
- Java DFS w/ memorization
0348 Design Tic-Tac-Toe
- Java N^2
- Java Arrays
0419 Battleships in a Board
- Java HashSet
0560 Subarray Sum Equals K
- Java N
- Java N^2
0566 Reshape the Matrix
- Java Grid Iteration
0657 Robot Return to Origin
- Java Iteration w/ Switch Case
0832 Flipping an Image
- Java Iterate through 2D Array
0867 Transpose Matrix
- Java Deep Copy
0994 Rotting Oranges
- Java Breadth First Search
0999 Available Captures for Rook
- Java Grid Iteration
0026 Remove Duplicates from Sorted Array
- Java Two Indices
0027 Remove Element
- Java Double Pass
- Java Single Pass
0035 Search Insert Position
- Java Iterative Search
- Java Binary Search
0041 First Missing Positive
- Java int[] hashMap
0042 Trapping Rain Water
- Java Dynamic Programming
0053 Maximum Subarray
- Java Greedy Algorithm
- Java Dynamic Programming
0055 Jump Game
- Java Backtracking
- Java Dynamic Programming
0061 Rotate List
- Java Loop/Break
0088 Merge Sorted Array
- Java 3 Indices New Array Merge
- Java 3 Indices Backwards Merge
0121 Best Time to Buy and Sell Stock
- Java Iteration
0122 Best Time to Buy and Sell Stock II
- Java Single Pass Profitable Ranges
- Java Single Pass Increase Sumnation
0123 Best Time to Buy and Sell Stock III
- Java Dynamic Programming
- Java One Pass
0128 Longest Consecutive Sequence
- Java Hashset Iteration
0134 Gas Station
- Java N^2
- Java One Pass
0162 Find Peak Element
- Java Iterative
0169 Majority Element
- Java HashMap Iterative
- Java Sorting
0189 Rotate Array
- Java Array
- Java Cycle Replacements
0209 Minimum Size Subarray Sum
- Java Iterative
- Java Two Pointers
0217 Contains Duplicate
- Python3 Hashmap
- Java Sorting
- Java HashSet
0219 Contains Duplicate II
- Java HashMap
- Java BST
0238 product of array except self
- Java Multi-Array Pass
- Java Array Optimize
0287 Find the Duplicate Number
- Java HashSet
- Java Sorting
- Java Turtle / Rabbit
0300 Longest Increasing Subsequence
- Java Recursion w/ memory
0389 Find the Difference
- Java Sorting
0349 Intersection of Two Arrays
- Java Hashsets
0442 Find All Duplicates in an Array
- Java Hashset
- Java Array Spot Marking
0561 Array Partition I
- Java Sorting
0567 String Permutation
- Java Array
0724 Find Pivot Index
- Java Three Pass
- Java Prefix Sum
0845 Longest Mountain in Array
- Java Two Pointers
0852 Peak Index in a Mountain Array
- Java Iteration
0896 Monotonic Array
- Java Iteration
0941 Valid Mountain Array
- Java Iterative
1051 Height Checker
- Java Sorting
1085 Sum of Digits in the Minimum Number
- Java Iterative
1103 Distribute Candies to People
- Java Iterative
1122 Relative Sort Array
- Java Hashmaps/Arraylist
1200 Minimum Absolute Difference
- Java Sorting/Adjacent Compares
1213 Intersection of Three Sorted Arrays
- Java HashSets
1313 Decompress Run-Length Encoded List
- Java Array Construction
1365 How Many Numbers Are Smaller Than the Current Number
- Java Nested Loops
1413 Minimum Value to Get Positive Step by Step Sum
- Java Iterative Find Min
1446 Consecutive Characters
- Java Iteration
1450 Number of Students Doing Homework at a Given Time
- Java Iteratrion
1480 Running Sum of 1d Array
- Java Linear Iteration
1550 Three Consecutive Odds
- Java Iteration
1652 Defuse the Bomb
- Java Iteration
0019 Remove Nth Node from End of List
- Java Two Pass
- Java Single Pass
0021 Merge Two Sorted Lists
- Jave Iteration
- Java Recursion
0023 Merge k Sorted Lists
- Java List Head Insertion
0024 Swap Nodes in Pairs
- Java Iterative
- Java Recursive
0025 Reverse K elements of linked list
- Java Iteration Linked Lists
0083 Remove Duplicates from Sorted List
- Java Iterate through List
0092 Reverse Linked List II
- Java Linked List Iteration
0138 Copy List with Random Pointer
- Python3 Recursive
- Python3 Iterative Memory Conservative
- Java Hashmap
0141 Linked List Cycle
- Python3 Hash Table Iteration
- Python3 "Circular" nodes
- Java HashSet
0142 Linked List Cycle II
- Python3 Hash Table Iteration
- Python3 "Circular" nodes
- Java HashSet
0143 Reorder List
- Python3 Iterative Solution
- Python3 List Manipulation
- Java Hashmap Two Ptrs
0160 Intersection of Two Linked Lists
- Java hashSet
- Java two ptrs
0203 Remove Linked List Elements
- Java Iterative
- Java Sentinel Node
0206 Reverse List
- Java Iterative
- Java Recursive
0234 Palindrome Linked List
- Java Stacks
- Java Two Pointers List Reversal
0237 Delete Node in a Linked List
- Java Node Shift
0328 Odd Even Linked List
- Java Setinel Nodes
- Java Linked List Iteration, Two Tails
0876 Middle of Linked Lists
- Java Linked List Iteration
- Java ArrayList
1290 Convert Binary Number in a Linked List to Integer
- Java Linked List Iteration
- Java Math
0069 Sqrt(x)
- Java Linear Pass
- Java Binary Search
0204 Count Primes
- Java Sieve of Eratosthenes
0268 Missing Number
- Java Math (basic summation)
- Java Math Optimized (basic summation)
0445 Add Two Numbers II
- Java Linked List Reversal
0509 Fibonacci Number
- Java Recursion
- Java Iterative
1486 XOR Operation in an Array
- Java Iterative
1720 Decode XORed Array
- Java Iterative
0007 Reverse Integer
- Java Parse Int
0022 Generate Parentheses
- Java Backtracking
0046 Permutations
- Java Backtracking
0146 LRU Cache
- Java LinkedHashMap
- Python OrderedDict
0168 Excel Sheet Column Title
- Java Decode Digit
0252 Meeting Rooms
- Java HashSet
- Java Sorting
0278 First Bad Version
- Java Binary Search
0346 Moving Average from Data Stream
- Java ArrayList
0403 Frog Jump
- Java Backtracking
- Java hashMap & hashSet dynamic programming
0645 Set Mismatch
- Java HashSet & Summation
0771 Jewels and Stones
- Java HashMap
1436 Destination City
- Java hashSet
0232 Implement Queue using Stacks
- Java Two Stacks
- Java Two Stack Optimized
0033 Search in Rotated Sorted Array
- Java Two Binary Searches
0034 Find First and Last Position of Element in Sorted Array
- Java Binary Search
0075 Sort Colors
- Java Two Pass Counting Sort
- Java One Pass Dutch National Flag Problem
0148 Sort List
- Java Bubble Sort
0215 Kth Largest Element in an Array
- Java Sorting
- Java Minheap
0702 Search in a Sorted Array of Unknown Size
- Java Binary Search Boundary Detection
- Java Binary Search Logarithmic Boundary Detection
0977 Squares of a Sorted Array
- Java Sorting
- Java Two Pointers