Skip to content

Latest commit

History

55 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Introduction

These are my solutions to Leetcode problems in Java 8. I have tried to keep the solutions clear and concise, but there might be opportunities for improvement. In that case, just send me a PR.

Problems tagged Easy

Problem IDProblemSolutionSpace ComplexityTime ComplexityRuntime (ms)
832Flipping an imageClickO(m*n)O(1)8
824Goat LatinClickO(n)O(1)95
830Positions of Large GroupsClickO(n)O(1)19
821Shortest Distance to a CharacterClickO(n)O(1)9
819Most Common WordClickO(n)O(n)84
811Subdomain Visit CountClickO(n)O(n)116
806Number of Lines to Write StringClickO(n)O(1)3
804Unique Morse Code WordsClickO(n)O(1)11
796Rotate StringClickO(n)O(1)4
788Rotated DigitsClickO(2^N * N)O(1)214
784Letter Case PermutationClickO(2 ^ n)O(2 ^ n) for returning, else O(1)97
783Minimum Distance Between BST NodesClickO(n)O(1)5
771Jewels and stonesClickO(n)O(1)19
695Max Area of IslandClickO(m * n)O(m * n)37
203Remove linked list elementsClickO(n)O(1)7
122Best Time to Buy and Sell Stock IIClickO(n)O(1)2
121Best Time to Buy and Sell StockClickO(n)O(1)1
111Minimum Depth of Binary TreeClickO(n)O(1)0
20Valid ParenthesesClickO(n)O(1)58

Problems tagged Medium

Problem IDProblemSolutionSpace ComplexityTime ComplexityRuntime (ms)
799Champagne TowerClickO(m * n)O(m * n)29
791Custom Sort StringClickO(n log n)O(1)92
785Is Graph Bipartite?ClickO(V+E)O(V)9
779k-th-symbol-in-grammarClickO(n)O(1)5
769Max Chunks to Make SortedClickO(n)O(1)4
767Reorganize StringClickO(n)O(1)11
764Largest Plus SignClickO(N ^ 2)O(N ^ 2)162
763Partition LabelsClickO(n)O(1)13
756Pyramid Transition MatrixClickExponentialO(n)28
547Friend CirclesClickO(n log n)O(n)13
449Serialize and Deserialize BSTClickO(n)O(n)110
332Reconstruct ItineraryClickO(n^2)O(n)13
207Course ScheduleClickO(V + E)O(V)10
200Number of IslandsClickO(m * n)O(m * n)7
130Surrounded RegionsClickO(m * n)O(m * n)6
127Word LadderClickO(n)O(n)459
107Binary Tree Level Order Traversal IIClickO(n)O(n)98
103Binary Tree Zigzag Level Order TraversalClickO(n)O(n)73
102Binary Tree Level Order TraversalClickO(n)O(n)66
100Same TreeClickO(n)O(1)3
94Binary Tree Inorder TraversalClickO(n)O(n)0
64Minimum Path SumClickO(m * n)O(m * n)8
63Unique Paths IIClickO(m * n)O(m * n)1
62Unique PathsClickO(m * n)O(m * n)1
17Letter Combinations of a Phone NumberClickO(n)O(1)46
3Longest Substring Without Repeating CharactersClickO(n)O(n)35
2Add Two NumbersClickO(n)O(1)60

Problems tagged Hard

Problem IDProblemSolutionSpace ComplexityTime ComplexityRuntime (ms)
765Couples Holding HandsClickO(n)O(n)5
297Serialize and Deserialize Binary TreeClickO(n)O(n)17
72Edit DistanceClickO(m * n)O(m * n)14
23Merge k Sorted ListsClickO(n)O(1)14

About

Keep calm and solve leetcode

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages