Skip to content

dmk326/Leetcode_fishcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

If you like this project, please leave me a star. โ˜…

"For coding interview preparation, LeetCode is one of the best online resource providing a rich library of more than 300 real coding interview questions for you to practice from using one of the 7 supported languages - C, C++, Java, Python, C#, JavaScript, Ruby."

Algorithms

# Title Solutions Video Difficulty Tag
1297 Maximum Number of Occurrences of a Substring Solution Medium
1296 Divide Array in Sets of K Consecutive Numbers Solution Medium
1295 Find Numbers with Even Number of Digits Solution Easy
1290 Convert Binary Number in a Linked List to Integer Solution Easy
1287 Element Appearing More Than 25% In Sorted Array Solution Easy
1282 Group the People Given the Group Size They Belong To Solution ๐Ÿ“บ Medium
1281 Subtract the Product and Sum of Digits of an Integer Solution Easy
1277 Count Square Submatrices with All Ones Solution Medium
1271 Hexspeak Solution Easy
1267 Count Servers that Communicate Solution Medium
1266 Minimum Time Visiting All Points Solution Easy
1260 Shift 2D Grid Solution ๐Ÿ“บ Easy
1252 Cells with Odd Values in a Matrix Solution Easy
1237 Find Positive Integer Solution for a Given Equation Solution Easy
1243 Array Transformation Solution ๐Ÿ“บ Easy
1232 Check If It Is a Straight Line Solution Easy
1228 Missing Number In Arithmetic Progression Solution Easy
1217 Play with Chips Solution Easy
1213 Intersection of Three Sorted Arrays Solution ๐Ÿ“บ Easy
1207 Unique Number of Occurrences Solution ๐Ÿ“บ Easy
1200 Minimum Absolute Difference Solution ๐Ÿ“บ Easy
1198 Find Smallest Common Element in All Rows Solution ๐Ÿ“บ Easy
1196 How Many Apples Can You Put into the Basket Solution Easy
1189 Maximum Number of Balloons Solution Easy
1185 Day of the Week Solution Easy
1184 Distance Between Bus Stops Solution ๐Ÿ“บ Easy
1165 Single-Row Keyboard Solution Easy
1160 Find Words That Can Be Formed by Characters Solution Easy
1154 Day of the Year Solution Easy
1150 Check If a Number Is Majority Element in a Sorted Array Solution Easy
1137 N-th Tribonacci Number Solution Easy
1134 Armstrong Number Solution ๐Ÿ“บ Easy
1133 Largest Unique Number Solution Easy
1128 Number of Equivalent Domino Pairs Solution ๐Ÿ“บ Easy
1122 Relative Sort Array Solution Easy
1170 Compare Strings by Frequency of the Smallest Character Solution Easy
1119 Remove Vowels from a String Solution ๐Ÿ“บ Easy
1108 Defanging an IP Address Solution ๐Ÿ“บ Easy
1099 Two Sum Less Than K Solution ๐Ÿ“บ Easy
1089 Duplicate Zeros Solution Easy
1086 High Five Solution ๐Ÿ“บ Easy
1085 Sum of Digits in the Minimum Number Solution ๐Ÿ“บ Easy
1079 Letter Tile Possibilities Solution Medium
1078 Occurrences After Bigram Solution Easy
1071 Greatest Common Divisor of Strings Solution Easy
1065 Index Pairs of a String Solution Medium
1056 Confusing Number Solution Easy
1055 Fixed Point Solution Easy
1051 Height Checker Solution Easy
1047 Remove All Adjacent Duplicates In String Solution Easy
1043 Partition Array for Maximum Sum Solution Medium DP
1038 Binary Search Tree to Greater Sum Tree Solution Medium DFS, tree
1037 Valid Boomerang Solution Easy Math
1033 Moving Stones Until Consecutive Solution Easy Math
1030 Matrix Cells in Distance Order Solution Easy
1029 Two City Scheduling Solution Easy
1022 Sum of Root To Leaf Binary Numbers Solution Easy
1021 Remove Outermost Parentheses Solution Easy
1020 Number of Enclaves Solution Medium Graph, DFS, BFS, recursion
1018 Binary Prefix Divisible By 5 Solution Easy
1014 Best Sightseeing Pair Solution Medium
1013 Partition Array Into Three Parts With Equal Sum Solution Easy
1011 Capacity To Ship Packages Within D Days Solution Medium Binary Search
1010 Pairs of Songs With Total Durations Divisible by 60 Solution Easy
1009 Complement of Base 10 Integer Solution Easy
1008 Construct Binary Search Tree from Preorder Traversal Solution Medium Recursion
1003 Check If Word Is Valid After Substitutions Solution Medium
1002 Find Common Characters Solution Easy
999 Available Captures for Rook Solution Easy
997 Find the Town Judge Solution Easy
994 Rotting Oranges Solution Easy BFS
993 Cousins in Binary Tree Solution Easy Tree, BFS
989 Add to Array-Form of Integer Solution Easy Array
987 Vertical Order Traversal of a Binary Tree Solution Medium Recursion
985 Sum of Even Numbers After Queries Solution Easy Array
979 Distribute Coins in Binary Tree Solution Medium Recursion
977 Squares of a Sorted Array Solution Easy Array
976 Largest Perimeter Triangle Solution Easy Math Array
974 Subarray Sums Divisible by K Solution Medium Array
973 K Closest Points to Origin Solution Easy Math Sort
970 Powerful Integers Solution Easy Math
966 Vowel Spellchecker Solution Medium Hash Table, String
965 Univalued Binary Tree Solution Easy DFS, recursion
961 N-Repeated Element in Size 2N Array Solution Easy
954 Array of Doubled Pairs Solution ๐Ÿ“บ Medium
953 Verifying an Alien Dictionary Solution Easy
951 Flip Equivalent Binary Trees Solution Medium Tree, DFS, recursion
950 Reveal Cards In Increasing Order Solution Medium
944 Delete Columns to Make Sorted Solution Easy
942 DI String Match Solution Easy
941 Valid Mountain Array Solution Easy
938 Range Sum of BST Solution Medium BST, recursion, DFS
937 Reorder Log Files Solution Easy
935 Knight Dialer Solution Medium
933 Number of Recent Calls Solution Easy
929 Unique Email Addresses Solution Easy
925 Long Pressed Name Solution Easy
922 Sort Array By Parity II Solution Easy
917 Reverse Only Letters Solution Easy
914 X of a Kind in a Deck of Cards Solution Easy
912 Sort an Array Solution Easy
908 Smallest Range I Solution Easy
900 RLE Iterator Solution Medium
897 Increasing Order Search Tree Solution Easy DFS, recursion
896 Monotonic Array Solution Easy
890 Find and Replace Pattern Solution Medium
893 Groups of Special-Equivalent Strings Solution Easy
888 Fair Candy Swap Solution Easy
885 Spiral Matrix III Solution Medium
884 Uncommon Words from Two Sentences Solution Easy
876 Middle of the Linked List Solution Easy
872 Leaf-Similar Trees Solution Easy DFS, recursion
868 Binary Gap Solution Easy
867 Transpose Matrix Solution Easy
860 Lemonade Change Solution Easy
859 Buddy Strings Solution Easy
852 Peak Index in a Mountain Array Solution Easy
849 Maximize Distance to Closest Person Solution Easy
844 Backspace String Compare Solution Easy
840 Magic Squares In Grid Solution Easy
836 Rectangle Overlap Solution Easy
832 Flipping an Image Solution Easy
830 Positions of Large Groups Solution Easy
824 Goat Latin Solution Easy
821 Shortest Distance to a Character Solution Easy
819 Most Common Word Solution Easy HashMap
814 Binary Tree Pruning Solution Medium recursion, DFS
811 Subdomain Visit Count Solution Easy HashMap
806 Number of Lines To Write String Solution Easy
804 Unique Morse Code Words Solution Easy
800 Similar RGB Color Solution Easy
799 Champagne Tower Solution Medium
796 Rotate String Solution Easy
791 Custom Sort String Solution Medium
789 Escape The Ghosts Solution Medium Math
788 Rotated Digits Solution Easy
784 Letter Case Permutation Solution Easy
783 Minimum Distance Between BST Nodes Solution Easy
779 K-th Symbol in Grammar Solution Medium
776 Split BST Solution Medium Recursion
771 Jewels and Stones Solution Easy
769 Max Chunks To Make Sorted Solution Medium Array
767 Reorganize String Solution Medium
766 Toeplitz Matrix Solution Easy
765 Couples Holding Hands Solution Hard
764 Largest Plus Sign Solution Medium DP
763 Partition Labels Solution Medium
762 Prime Number of Set Bits in Binary Representation Solution Easy
760 Find Anagram Mappings Solution Easy
758 Bold Words in String Solution Easy
756 Pyramid Transition Matrix Solution Medium Backtracking
755 Pour Water Solution Medium Array
754 Reach a Number Solution Medium Math
750 Number Of Corner Rectangles Solution Medium
748 Shortest Completing Word Solution Easy
747 Largest Number Greater Than Twice of Others Solution Easy
746 Min Cost Climbing Stairs Solution Easy
744 Find Smallest Letter Greater Than Target Solution Easy
743 Network Delay Time Solution Medium Graph, Djikstra
740 Delete and Earn Solution Medium
739 Daily Temperatures Solution Medium
738 Monotone Increasing Digits Solution Medium
737 Sentence Similarity II Solution Medium Union Find
735 Asteroid Collision Solution Medium Stack
734 Sentence Similarity Solution Easy HashTable
733 Flood Fill Solution Easy BFS, DFS
729 My Calendar I Solution Medium
728 Self Dividing Numbers Solution Easy
727 Minimum Window Subsequence Solution Hard DP
725 Split Linked List in Parts Solution Medium LinkedList
724 Find Pivot Index Solution Easy Array
723 Candy Crush Solution Medium Array, Two Pointers
721 Accounts Merge Solution Medium DFS, Union Find
720 Longest Word in Dictionary Solution Easy Trie
719 Find K-th Smallest Pair Distance Solution Hard Binary Search
718 Maximum Length of Repeated Subarray Solution Medium DP
717 1-bit and 2-bit Characters Solution Easy
716 Max Stack Solution Hard Design
714 Best Time to Buy and Sell Stock with Transaction Fee Solution Medium DP
713 Subarray Product Less Than K Solution Medium
712 Minimum ASCII Delete Sum for Two Strings Solution Medium DP
709 To Lower Case Solution Easy String
706 Design HashMap Solution Easy Design
705 Design HashSet Solution Easy Design
704 Binary Search Solution Easy Binary Search
703 Kth Largest Element in a Stream Solution Easy
701 Insert into a Binary Search Tree Solution Medium DFS, recursion
700 Search in a Binary Search Tree Solution Easy recusion, dfs
699 Falling Squares Solution Hard Segment Tree
698 Partition to K Equal Sum Subsets Solution Medium Backtracking
697 Degree of an Array Solution Easy
696 Count Binary Substrings Solution Easy
695 Max Area of Island Solution Easy DFS
694 Number of Distinct Islands Solution Medium DFS
693 Binary Number with Alternating Bits Solution Easy
692 Top K Frequent Words Solution Medium
691 Stickers to Spell Word Solution Hard DP
690 Employee Importance Solution Easy DFS
689 Maximum Sum of 3 Non-Overlapping Subarrays Solution Hard DP
688 Knight Probability in Chessboard Solution Medium DP
687 Longest Univalue Path Solution Easy DFS
686 Repeated String Match Solution Easy
685 Redundant Connection II Solution Hard Union Find
684 Redundant Connection Solution Medium Union Find
683 K Empty Slots Solution Hard
682 Baseball Game Solution Easy
681 Next Closest Time Solution Medium
680 Valid Palindrome II Solution Easy String
679 24 Game Solution Hard Recursion
678 Valid Parenthesis String Solution Medium Recursion, Greedy
677 Map Sum Pairs Solution Medium HashMap
676 Implement Magic Dictionary Solution Medium
675 Cut Off Trees for Golf Event Solution Hard BFS
674 Longest Continuous Increasing Subsequence Solution Easy
673 Number of Longest Increasing Subsequence Solution Medium DP
672 Bulb Switcher II Solution Medium Math
671 Second Minimum Node In a Binary Tree Solution Easy Tree, DFS
670 Maximum Swap Solution Medium String
669 Trim a Binary Search Tree Solution Easy Tree, DFS
668 Kth Smallest Number in Multiplication Table Solution Hard Binary Search
667 Beautiful Arrangement II Solution Medium Array
666 Path Sum IV Solution Medium Tree, DFS
665 Non-decreasing Array Solution Easy
664 Strange Printer Solution Hard DP
663 Equal Tree Partition Solution Medium Tree
662 Maximum Width of Binary Tree Solution Medium BFS, DFS
661 Image Smoother Solution Easy Array
660 Remove 9 Solution Hard Math
659 Split Array into Consecutive Subsequences Solution Medium HashMap
658 Find K Closest Elements Solution Medium
657 Judge Route Circle Solution Easy
656 Coin Path Solution Hard DP
655 Print Binary Tree Solution Medium Recursion
654 Maximum Binary Tree Solution Medium Tree
653 Two Sum IV - Input is a BST Solution Easy Tree
652 Find Duplicate Subtrees Solution Medium Tree
651 4 Keys Keyboard Solution Medium DP
650 2 Keys Keyboard Solution Medium DP
649 Dota2 Senate Solution Medium Greedy
648 Replace Words Solution Medium Trie
647 Palindromic Substrings Solution Medium DP
646 Maximum Length of Pair Chain Solution Medium DP, Greedy
645 Set Mismatch Solution Easy
644 Maximum Average Subarray II Solution Hard Binary Search
643 Maximum Average Subarray I Solution Easy
642 Design Search Autocomplete System Solution Hard Design
640 Solve the Equation Solution Medium
639 Decode Ways II Solution Hard DP
638 Shopping Offers Solution Medium DP, DFS
637 Average of Levels in Binary Tree Solution Easy
636 Exclusive Time of Functions Solution Medium Stack
635 Design Log Storage System Solution Medium Design
634 Find the Derangement of An Array Solution Medium Math
633 Sum of Square Numbers Solution Easy Binary Search
632 Smallest Range Solution Hard Heap
631 Design Excel Sum Formula Solution Hard Design, Topological Sort
630 Course Schedule III Solution Hard Heap, Greedy
629 K Inverse Pairs Array Solution Hard DP
628 Maximum Product of Three Numbers Solution Easy
625 Minimum Factorization Solution Medium
624 Maximum Distance in Arrays Solution Easy Sort, Array
623 Add One Row to Tree Solution Medium Tree
621 Task Scheduler Solution Medium Greedy, Queue
617 Merge Two Binary Trees Solution Easy Tree, Recursion
616 Add Bold Tag in String Solution Medium String
611 Valid Triangle Number Solution Medium Binary Search
609 Find Duplicate File in System Solution Medium HashMap
606 Construct String from Binary Tree Solution Easy Tree, Recursion
605 Can Place Flowers Solution Easy Array
604 Design Compressed String Iterator Solution Easy Design, String
600 Non-negative Integers without Consecutive Ones Solution Hard Bit Manipulation, DP
599 Minimum Index Sum of Two Lists Solution Easy HashMap
598 Range Addition II Solution Easy
594 Longest Harmonious Subsequence Solution Easy Array, HashMap
593 Valid Square Solution Medium Math
592 Fraction Addition and Subtraction Solution Medium Math
591 Tag Validator Solution Hard Stack, String
590 N-ary Tree Postorder Traversal Solution Easy DFS, recursion
589 N-ary Tree Preorder Traversal Solution Easy DFS, recursion
588 Design In-Memory File System Solution Hard Trie, Design
587 Erect the Fence Solution Hard Geometry
583 Delete Operation for Two Strings Solution Medium DP
582 Kill Process Solution Medium Stack
581 Shortest Unsorted Continuous Subarray Solution Easy Array, Sort
576 Out of Boundary Paths Solution Hard DP, DFS
575 Distribute Candies Solution Easy Array
573 Squirrel Simulation Solution Medium Math
572 Subtree of Another Tree Solution Easy Tree
568 Maximum Vacation Days Solution Hard DP
567 Permutation in String Solution Medium Sliding Windows, Two Pointers
566 Reshape the Matrix Solution Easy
565 Array Nesting Solution Medium
563 Binary Tree Tilt Solution Easy Tree Recursion
562 Longest Line of Consecutive One in Matrix Solution Medium Matrix DP
561 Array Partition I Solution Easy Array
560 Subarray Sum Equals K Solution Medium Array, HashMap
559 Maximum Depth of N-ary Tree Solution Easy DFS, recursion
557 Reverse Words in a String III Solution Easy String
556 Next Greater Element III Solution Medium String
555 Split Concatenated Strings Solution Medium String
554 Brick Wall Solution Medium HashMap
553 Optimal Division Solution O(n) O(n)
552 Student Attendance Record II Solution O(n) O(1)
551 Student Attendance Record I Solution O(n) O(1)
549 Binary Tree Longest Consecutive Sequence II Solution O(n) O(n)
548 Split Array with Equal Sum Solution O(n^2) O(n)
547 Friend Circles Solution O(n^2) O(n)
546 Remove Boxes Solution O(n^3) O(n^3)
545 Boundary of Binary Tree Solution O(n) O(n)
544 Output Contest Matches Solution O(n) O(n)
543 Diameter of Binary Tree Solution O(n) O(h)
542 01 Matrix Solution O(m*n) O(n)
541 Reverse String II Solution O(n) O(1)
540 Single Element in a Sorted Array Solution O(n) O(1)
539 Minimum Time Difference Solution O(logn) O(1)
538 Convert BST to Greater Tree Solution O(n) O(h)
537 Complex Number Multiplication Solution O(1) O(1)
536 Construct Binary Tree from String Solution O(n) O(h)
535 Encode and Decode TinyURL Solution O(1) O(n)
533 Lonely Pixel II Solution O(m*n) O(m) (m is number of rows)
532 K-diff Pairs in an Array Solution O(n) O(n)
531 Lonely Pixel I Solution O(m*n) O(1)
530 Minimum Absolute Difference in BST Solution O(n) O(n)
529 Minesweeper Solution O(m*n) O(k)
527 Word Abbreviation Solution O(n^2) O(n)
526 Beautiful Arrangement Solution O(n) O(h)
525 Contiguous Array Solution O(n) O(n)
524 Longest Word in Dictionary through Deleting Solution O(n) O(n)
523 Continuous Subarray Sum Solution O(n) O(1)
522 Longest Uncommon Subsequence II Solution O(x*n^2) (x is average length of strings) O(1)
521 Longest Uncommon Subsequence I Solution O(max(x,y)) (x and y are length of strings) O(1)
520 Detect Capital Solution O(n) O(1)
517 Super Washing Machines Solution
516 Longest Palindromic Subsequence Solution O(n^2) O(n^2)
515 Find Largest Value in Each Tree Row Solution O(n) O(k)
514 Freedom Trail Solution O(?) O(?)
513 Find Bottom Left Tree Value Solution O(n) O(k)
509 Fibonacci Number Solution ๐Ÿ“บ
508 Most Frequent Subtree Sum Solution O(n) O(n)
507 Perfect Number Solution O(sqrt(n)) O(1)
506 Relative Ranks Solution O(nlogn) O(n)
505 The Maze II Solution O(m*n) O(m*n)
504 Base 7 Solution O(1) O(1)
503 Next Greater Element II Solution O(n) O(n)
502 IPO Solution O(nlogn) O(n)
501 Find Mode in Binary Tree Solution O(n) O(k)
500 Keyboard Row Solution O(n) O(1)
499 The Maze III Solution O(m*n) O(m*n)
496 Next Greater Element I Solution O(n*m) O(1)
498 Diagonal Traverse Solution O(m*n) O(1)
495 Teemo Attacking Solution O(n) O(1)
494 Target Sum Solution O(2^n) O(1)
493 Reverse Pairs Solution O(nlogn) O(1)
492 Construct the Rectangle Solution O(n) O(1)
491 Increasing Subsequences Solution O(n!) O(n)
490 The Maze Solution O(m*n) O(m*n)
488 Zuma Game Solution O(?) O(?)
487 Max Consecutive Ones II Solution O(n) O(n)
486 Predict the Winner Solution O(2^n) O(n^2)
485 Max Consecutive Ones Solution O(n) O(1)
484 Find Permutation Solution O(n) O(1)
483 Smallest Good Base Solution O(logn) O(1)
482 License Key Formatting Solution O(n) O(n)
481 Magical String Solution O(?) O(?)
480 Sliding Window Median Solution O(nlogk) O(k)
479 Largest Palindrome Product Solution O(n) O(1)
477 Total Hamming Distance Solution O(n) O(1)
476 Number Complement Solution O(n) O(1)
475 Heaters Solution max(O(nlogn), O(mlogn)) - m is the length of houses, n is the length of heaters O(1)
474 Ones and Zeroes Solution O(n) O(m*n)
473 Matchsticks to Square Solution O(n!) O(n)
472 Concatenated Words Solution O(n^2) O(n)
471 Encode String with Shortest Length Solution O(n^3) O(n^2)
469 Convex Polygon Solution O(n) O(1)
468 Validate IP Address Solution O(n) O(1)
467 Unique Substrings in Wraparound String Solution O(n) O(1)
466 Count The Repetitions Solution O(max(m,n)) O(1)
465 Optimal Account Balancing Solution
464 Can I Win Solution O(2^n) O(n)
463 Island Perimeter Solution O(m*n) O(1)
462 Minimum Moves to Equal Array Elements II Solution O(nlogn) O(1)
461 Hamming Distance Solution O(n) O(1)
460 LFU Cache Solution O(1) O(n)
459 Repeated Substring Pattern Solution O(n) O(n)
458 Poor Pigs Solution O(1) O(1)
457 Circular Array Loop Solution O(n) O(1)
456 132 Pattern Solution O(n) O(n)
455 Assign Cookies Solution O(n) O(1)
454 4Sum II Solution O(n) O(n)
453 Minimum Moves to Equal Array Elements Solution O(n) O(1)
452 Minimum Number of Arrows to Burst Balloons Solution O(nlogn) O(1)
451 Sort Characters By Frequency Solution O(nlogn) O(n)
450 Delete Node in a BST Solution O(?) O(?)
449 Serialize and Deserialize BST Solution O(n) O(h)
448 Find All Numbers Disappeared in an Array Solution O(n) O(1)
447 Number of Boomerangs Solution O(n^2) O(n)
446 Arithmetic Slices II - Subsequence Solution O(n^2) O(n^2)
445 Add Two Numbers II Solution O(max(m,n) O(max(m,n))
444 Sequence Reconstruction Solution O(n) O(n)
443 String Compression Solution O(n) O(n)
442 Find All Duplicates in an Array Solution O(n) O(1)
441 Arranging Coins Solution O(n) O(1)
440 K-th Smallest in Lexicographical Order Solution O(n^2) O(1)
439 Ternary Expression Parser Solution O(n) O(n)
438 Find All Anagrams in a String Solution O(n) O(1)
437 Path Sum III Solution O(n^2) O(n)
436 Find Right Interval Solution O(nlogn) O(n)
435 Non-overlapping Intervals Solution O(nlogn) O(1)
434 Number of Segments in a String Solution O(n) O(1)
432 All O`one Data Structure Solution O(1) O(n)
429 N-ary Tree Level Order Traversal Solution O(n) O(n)
425 Word Squares Solution O(n!) O(n)
424 Longest Repeating Character Replacement Solution O(n) O(1)
423 Reconstruct Original Digits from English Solution O(n) O(1)
422 Valid Word Square Solution O(n) O(1)
421 Maximum XOR of Two Numbers in an Array Solution O(n) O(1)
420 Strong Password Checker Solution ? ?
419 Battleships in a Board Solution O(m*n) O(1)
418 Sentence Screen Fitting Solution O(n) O(1)
417 Pacific Atlantic Water Flow Solution O(mnMax(m,n)) O(m*n)
416 Partition Equal Subset Sum Solution O(m*n) O(m*n)
415 Add Strings Solution O(n) O(1)
414 Third Maximum Number Solution O(n) O(1)
413 Arithmetic Slices Solution O(n) O(1)
412 Fizz Buzz Solution O(n) O(1)
411 Minimum Unique Word Abbreviation Solution O(?) O(?)
410 Split Array Largest Sum Solution O(nlogn) O(1)
409 Longest Palindrome Solution O(n) O(1)
408 Valid Word Abbreviation Solution O(n) O(1)
407 Trapping Rain Water II Solution
406 Queue Reconstruction by Height Solution O(nlogn) O(1)
405 Convert a Number to Hexadecimal Solution O(n) O(1)
404 Sum of Left Leaves Solution O(n) O(h)
403 Frog Jump Solution O(n^2) O(n^2)
402 Remove K Digits Solution O(n) O(n)
401 Binary Watch Solution O(1) O(1)
400 Nth Digit Solution O(n) O(1)
399 Evaluate Division Solution O(n*n!) O(n)
398 Random Pick Index Solution
397 Integer Replacement Solution ? ?
396 Rotate Function Solution O(n^2) could be optimized to O(n) O(1)
395 Longest Substring with At Least K Repeating Characters Solution O(n^2) O(1)
394 Decode String Solution O(n) O(n)
393 UTF-8 Validation Solution O(?) O(?)
392 Is Subsequence Solution O(m*n) O(1)
391 Perfect Rectangle Solution O(n) O(1)
390 Elimination Game Solution O(logn) O(1)
389 Find the Difference Solution O(n) O(1)
388 Longest Absolute File Path Solution O(n) O(d)
387 First Unique Character in a String Solution O(n) O(n)
386 Lexicographical Numbers Solution O(n) O(1)
385 Mini Parser Solution O(n) O(h)
384 Shuffle an Array Solution O(n) O(n)
383 Ransom Note Solution O(n) O(n)
382 Linked List Random Node Solution O(1) O(n)
381 Insert Delete GetRandom O(1) - Duplicates allowed Solution
380 Insert Delete GetRandom O(1) Solution O(n) O(1)
379 Design Phone Directory Solution O(1) O(n)
378 Kth Smallest Element in a Sorted Matrix Solution O(logm*n) O(1)
377 Combination Sum IV Solution O(n^2) O(n)
376 Wiggle Subsequence Solution O(n) O(1)
375 Guess Number Higher or Lower II Solution O(n^2) O(n^2)
374 Guess Number Higher or Lower Solution O(logn) O(1)
373 Find K Pairs with Smallest Sums Solution O(klogk) O(k)
372 Super Pow Solution O(n) O(1)
371 Sum of Two Integers Solution O(n) O(1)
370 Range Addition Solution O(n+k) O(1)
369 Plus One Linked List Solution O(n) O(1)
368 Largest Divisible Subset Solution O(n^2) O(n)
367 Valid Perfect Square Solution O(n) O(1)
366 Find Leaves of Binary Tree Solution O(n) O(h)
365 Water and Jug Problem Solution O(n) O(1)
364 Nested List Weight Sum II Solution O(n) O(h)
363 Max Sum of Rectangle No Larger Than K Solution
362 Design Hit Counter Solution O(1) amortized O(k)
361 Bomb Enemy Solution O(?) O(?)
360 Sort Transformed Array Solution O(n) O(1)
359 Logger Rate Limiter Solution amortized O(1) O(k)
358 Rearrange String k Distance Apart Solution O(n) O(n)
357 Count Numbers with Unique Digits Solution O(n) O(1)
356 Line Reflection Solution O(n) O(n)
355 Design Twitter Solution O(n) O(n)
354 Russian Doll Envelopes Solution O(nlogn) O(1)
353 Design Snake Game Solution O(?) O(?)
352 Data Stream as Disjoint Intervals Solution O(logn) O(n)
351 Android Unlock Patterns Solution O(?) O(?)
350 Intersection of Two Arrays II Solution O(m+n) O((m+n)) could be optimized
349 Intersection of Two Arrays Solution O(m+n) O(min(m,n))
348 Design Tic-Tac-Toe Solution O(1) O(n)
347 Top K Frequent Elements Solution O(n) O(k) k is is the number of unique elements in the given array
346 Moving Average from Data Stream Solution O(1) O(w))
345 Reverse Vowels of a String Solution O(n) O(1)
344 Reverse String Solution O(n) O(1)
343 Integer Break Solution O(1) O(1)
342 Power of Four Solution O(n) O(1)
341 Flatten Nested List Iterator Solution O(n) O(n)
340 Longest Substring with At Most K Distinct Characters Solution O(n) O(1)
339 Nested List Weight Sum Solution O(n) O(h))
338 Counting Bits Solution O(nlogn) O(h)
337 House Robber III Solution O(n) O(n)
336 Palindrome Pairs Solution O(n^2) O(n)
335 Self Crossing Solution O(n) O(1)
334 Increasing Triplet Subsequence Solution O(n) O(1)
333 Largest BST Subtree Solution O(n) O(n)
332 Reconstruct Itinerary Solution O(n) O(n)
331 Verify Preorder Serialization of a Binary Tree Solution O(n) O(n)
330 Patching Array Solution O(m+logn) O(1)
329 Longest Increasing Path in a Matrix Solution O(m*n) O(m*n)
328 Odd Even Linked List Solution O(n) O(1)
327 Count of Range Sum Solution O(nlogn) O(n)
326 Power of Three Solution O(1) O(1)
325 Maximum Size Subarray Sum Equals k Solution O(n) O(n)
324 Wiggle Sort II Solution O(n) O(n)
323 Number of Connected Components in an Undirected Graph Solution O(?) O(?)
322 Coin Change Solution O(n*k) O(k)
321 Create Maximum Number Solution O(?) O(?)
320 Generalized Abbreviation Solution O(n*2^n) O(n)
319 Bulb Switcher Solution O(1) O(1)
318 Maximum Product of Word Lengths Solution O(n^2) O(n)
317 Shortest Distance from All Buildings Solution O(?) O(?)
316 Remove Duplicate Letters Solution O(n) O(1)
315 Count of Smaller Numbers After Self Solution O(?) O(?)
314 Binary Tree Vertical Order Traversal Solution O(n) O(n)
313 Super Ugly Number Solution O(?) O(?)
312 Burst Balloons Solution O(?) O(?)
311 Sparse Matrix Multiplication Solution O(mnl) O(m*l)
310 Minimum Height Trees Solution ? ?
309 Best Time to Buy and Sell Stock with Cooldown Solution O(n) O(1)
308 Range Sum Query 2D - Mutable Solution ? ?
307 Range Sum Query - Mutable Solution ? ?
306 Additive Number Solution O(n^2) O(n)
305 Number of Islands II Solution ? ?
304 Range Sum Query 2D - Immutable Solution ? ?
303 Range Sum Query - Immutable Solution O(n) O(1)
302 Smallest Rectangle Enclosing Black Pixels Solution ? O(m*n)
301 Remove Invalid Parentheses Solution ? ?
300 Longest Increasing Subsequence Solution O(logn) O(n)
299 Bulls and Cows Solution O(n) O(1)
298 Binary Tree Longest Consecutive Sequence Solution O(n) O(n)
297 Serialize and Deserialize Binary Tree Solution O(n) O(h)
296 Best Meeting Point Solution ? ?
295 Find Median from Data Stream Solution O(logn) O(n)
294 Flip Game II Solution O(?) O(?)
293 Flip Game Solution O(n) O(1)
292 Nim Game Solution O(1) O(1)
291 Word Pattern II Solution O(n) O(n)
290 Word Pattern Solution O(n) O(n)
289 Game of Life Solution O(m*n) O(m*n), could be optimized to O(1)
288 Unique Word Abbreviation Solution O(n) O(1)
287 Find the Duplicate Number Solution O(n) O(1)
286 Walls and Gates Solution O(m*n) O(g)
285 Inorder Successor In BST Solution O(h) O(1)
284 Peeking Iterator Solution O(n) O(n)
283 Move Zeroes Solution O(n) O(1)
282 Expression Add Operators Solution O(?) O(?)
281 Zigzag Iterator Solution O(1) O(k)
280 Wiggle Sort Solution O(n) O(1)
279 Perfect Squares Solution O(n) O(1)
278 First Bad Version Solution O(logn) O(1)
277 Find the Celebrity Solution O(n) O(1)
276 Paint Fence Solution O(n) O(1)
275 H-Index II Solution O(logn) O(1)
274 H-Index Solution O(nlogn) O(1)
273 Integer to English Words Solution O(n) O(1)
272 Closest Binary Search Tree Value II Solution O(h+k) O(h)
271 Encode and Decode Strings Solution O(n) O(1)
270 Closest Binary Search Tree Value Solution O(h) O(1)
269 Alien Dictionary Solution O(?) O(?)
268 Missing Number Solution O(n) O(1)
267 Palindrome Permutation II Solution O(n*n!) O(n)
266 Palindrome Permutation Solution O(n) O(1)
265 Paint House II Solution O(n*k) O(1)
264 Ugly Number II Solution O(n) O(n)
263 Ugly Number Solution O(n) O(1)
261 Graph Valid Tree Solution O(V+E) O(V+E)
260 Single Number III Solution O(n) O(n)
259 3Sum Smaller Solution O(n^2) O(1)
258 Add Digits Solution O(1) O(1)
257 Binary Tree Paths Solution O(n*h) O(h)
256 Paint House Solution O(n) O(1)
255 Verify Preorder Sequence in Binary Search Tree Solution O(n) O(h)
254 Factor Combinations Solution O(nlogn) O(nlogn)
253 Meeting Rooms II Solution O(nlogn) O(h)
252 Meeting Rooms Solution O(nlogn) O(1)
251 Flatten 2D Vector Solution O(1) O(m*n)
250 Count Univalue Subtrees Solution O(n) O(h)
249 Group Shifted Strings Solution O(nlogn) O(n)
248 Strobogrammatic Number III Solution O(?) O(?)
247 Strobogrammatic Number II Solution O(n^2) O(n)
246 Strobogrammatic Number Solution O(n) O(1)
245 Shortest Word Distance III Solution O(n) O(1)
244 Shortest Word Distance II Solution O(n) O(n)
243 Shortest Word Distance Solution O(n) O(1)
242 Valid Anagram Solution O(n) O(1)
241 Different Ways to Add Parentheses Solution O(O(n * 4^n / n^(3/2))) O(n * 4^n / n^(3/2))
240 Search a 2D Matrix II Solution O(m+n) O(1)
239 Sliding Window Maximum Solution O(nlogn) O(k)
238 Product of Array Except Self Solution O(n) O(1)
237 Delete Node in a Linked List Solution O(1) O(1)
236 Lowest Common Ancestor of a Binary Tree Solution O(n) O(h)
235 Lowest Common Ancestor of a Binary Search Tree Solution O(h) O(1)
234 Palindrome Linked List Solution O(n) O(1)
233 Number of Digit One Solution O(n) O(1)
232 Implement Queue using Stacks Solution O(n) O(n)
231 Power of Two Solution O(1) O(1)
230 Kth Smallest Element in a BST Solution O(n) O(k)
229 Majority Element II Solution O(n) O(1)
228 Summary Ranges Solution O(n) O(1)
227 Basic Calculator II Solution O(n) O(n)
226 Invert Binary Tree Solution O(n) O(h)
225 Implement Stack using Queues Solution O(n) O(n)
224 Basic Calculator Solution ? ?
223 Rectangle Area Solution O(1) O(1)
222 Count Complete Tree Nodes Solution O(?) O(h)
221 Maximal Square Solution O(?) O(h)
220 Contains Duplicate III Solution O(nlogn) O(n)
219 Contains Duplicate II Solution O(n) O(n)
218 The Skyline Problem Solution O(n) O(n)
217 Contains Duplicate Solution O(n) O(n)
216 Combination Sum III Solution O(k * C(n, k)) O(k)
215 Kth Largest Element in an Array Solution O(nlogn) O(n)
214 Shortest Palindrome Solution O(?) O(?)
213 House Robber II Solution O(n) O(n)
212 Word Search II Solution O(mnl) O(l)
211 Add and Search Word - Data structure design Solution O(n) O(h)
210 Course Schedule II Solution O(?) O(?)
209 Minimum Size Subarray Sum Solution O(n) O(1)
208 Implement Trie Solution O(n) O(1)
207 Course Schedule Solution O(?) O(?)
206 Reverse Linked List Solution O(n) O(1)
205 Isomorphic Strings Solution O(n) O(1)
204 Count Primes Solution O(nloglogn) O(n)
203 Remove Linked List Elements Solution O(n) O(1)
202 Happy Number Solution O(k) O(k)
201 Bitwise AND of Numbers Range Solution O(min(m,n)) O(1)
200 Number of Islands Solution O(m*n) O(m*n)
199 Binary Tree Right Side View Solution O(n) O(h)
198 House Robber Solution O(n) O(n)
191 Number of 1 Bits Solution O(1) O(1)
190 Reverse Bits Solution O(n) O(1)
189 Rotate Array Solution O(n) O(n), could be optimized to O(1)
188 Best Time to Buy and Sell Stock IV Solution O(n*k) O(n*k)
187 Repeated DNA Sequences Solution O(n) O(n)
186 Reverse Words in a String II Solution O(n) O(1)
179 Largest Number Solution O(?) O(?)
174 Dungeon Game Solution O(m*n) O(m*n)
173 Binary Search Tree Iterator Solution O(1) O(h)
172 Factorial Trailing Zeroes Solution O(logn) O(1)
171 Excel Sheet Column Number Solution O(n) O(1)
170 Two Sum III - Data structure design Solution O(n) O(n)
169 Majority Element Solution O(n) O(1)
168 Excel Sheet Column Title Solution O(n) O(1)
167 Two Sum II - Input array is sorted Solution O(n) O(1)
166 Fraction to Recurring Decimal Solution O(1) O(1)
165 Compare Version Numbers Solution O(n) O(1)
164 Maximum Gap Solution O(n) O(n)
163 Missing Ranges Solution O(n) O(1)
162 Find Peak Element Solution O(1) O(logn)/O(n)
161 One Edit Distance Solution O(n) O(1)
160 Intersection of Two Linked Lists Solution O(m+n) O(1)
159 Longest Substring with At Most Two Distinct Characters Solution O(n) O(1)
158 Read N Characters Given Read4 II - Call multiple times Solution O(n) O(1)
157 Read N Characters Given Read4 Solution O(n) O(1)
156 Binary Tree Upside Down Solution O(n) O(h)
155 Min Stack Solution O(1) O(n)
154 Find Minimum in Rotated Sorted Array II Solution O(logn) O(1)
153 Find Minimum in Rotated Sorted Array Solution O(logn) O(1)
152 Maximum Product Subarray Solution O(n) O(1)
151 Reverse Words in a String Solution O(n) O(n)
150 Evaluate Reverse Polish Notation Solution O(?) O(?)
149 Max Points on a Line Solution O(?) O(?)
148 Sort List Solution O(nlogn) O(h)
147 Insertion Sort List Solution O(n^2) O(1)
146 LRU Cache Solution amortized O(1) O(k)
145 Binary Tree Postorder Traversal Solution O(n) O(h)
144 Binary Tree Preorder Traversal Solution O(n) O(h)
143 Reorder List Solution O(n) O(1)
142 Linked List Cycle II Solution O(n) O(1)
141 Linked List Cycle Solution O(n) O(1)
140 Word Break II Solution ? O(n^2)
139 Word Break Solution O(n^2) O(n)
138 Copy List with Random Pointer Solution O(n) O(n)
137 Single Number II Solution O(n) O(1)
136 Single Number Solution O(n) O(1)
135 Candy Solution O(n) O(1)
134 Gas Station Solution O(n) O(1)
133 Clone Graph Solution O(n) O(n)
132 Palindrome Partitioning II Solution O(n^2) O(n^2)
131 Palindrome Partitioning Solution O(n^2) O(n^2)
130 Surrounded Regions Solution O(?) O(?)
129 Sum Root to Leaf Numbers Solution O(n) O(h)
128 Longest Consecutive Sequence Solution O(n) O(n)
127 Word Ladder Solution O(n^2) O(n)
126 Word Ladder II Solution O(?) O(?)
125 Valid Palindrome Solution O(n) O(1)
124 Binary Tree Maximum Path Sum Solution O(n) O(h)
123 Best Time to Buy and Sell Stock III Solution O(n) O(1)
122 Best Time to Buy and Sell Stock II Solution O(n) O(1)
121 Best Time to Buy and Sell Stock Solution O(n) O(1)
120 Triangle Solution O(m*n) O(n)
119 Pascal's Triangle II Solution O(n^2) O(k) ๐Ÿ“บ
118 Pascal's Triangle Solution O(n^2) O(1)
117 Populating Next Right Pointers in Each Node II Solution O(n) O(1)
116 Populating Next Right Pointers in Each Node Solution O(n) O(1)
115 Distinct Subsequences Solution O(m*n) O(m*n)
114 Flatten Binary Tree to Linked List Solution O(n) O(h)
113 Path Sum II Solution O(n) O(h)
112 Path Sum Solution O(n) O(1)
111 Minimum Depth of Binary Tree Solution O(n) O(1)~O(h)
110 Balanced Binary Tree Solution O(n) O(1)~O(h)
109 Convert Sorted List to Binary Search Tree Solution O(n) O(h)
108 Convert Sorted Array to Binary Search Tree Solution O(n) O(h)
107 Binary Tree Level Order Traversal II Solution O(nlogn) O(h)
106 Construct Binary Tree from Inorder and Postorder Traversal Solution O(n) O(n)
105 Construct Binary Tree from Preorder and Inorder Traversal Solution O(n) O(n)
104 Maximum Depth of Binary Tree Solution O(n) O(h)
103 Binary Tree Zigzag Level Order Traversal Solution O(n) O(h)
102 Binary Tree Level Order Traversal Solution O(n) O(h)
101 Symmetric Tree Solution O(n) O(h) ๐Ÿ“บ
100 Same Tree Solution O(n) O(h) ๐Ÿ“บ
99 Recover Binary Search Tree Solution O(?) O(?)
98 Validate Binary Search Tree Solution O(n) O(h)
97 Interleaving String Solution O(?) O(?)
96 Unique Binary Search Trees Solution O(n^2) O(n)
95 Unique Binary Search Trees II Solution O(?) O(?)
94 Binary Tree Inorder Traversal Solution O(n) O(h)
93 Restore IP Addresses Solution O(?) O(?)
92 Reverse Linked List II Solution O(n) O(1)
91 Decode Ways Solution O(n) O(n)
90 Subsets II Solution O(n^2) O(1)
89 Gray Code Solution O(n) O(1)
88 Merge Sorted Array Solution O(max(m,n)) O(1)
87 Scramble String Solution O(n^4) O(n^3
86 Partition List Solution O(n) O(1)
85 Maximal Rectangle Solution O(m*n) O(n)
84 Largest Rectangle in Histogram Solution O(n) O(n)
83 Remove Duplicates from Sorted List Solution O(n) O(1)
82 Remove Duplicates from Sorted List II Solution O(n) O(1)
81 Search in Rotated Sorted Array II Solution O(logn) O(1)
80 Remove Duplicates from Sorted Array II Solution O(n) O(n)
79 Word Search Solution O((m*n)^2) O(m*n)
78 Subsets Solution O(n^2) O(1)
77 Combinations Solution O(n!) O(n)
76 Minimum Window Substring Solution O(n) O(k)
75 Sort Colors Solution O(n) O(1)
74 Search a 2D Matrix Solution O(log(m*n)) O(1)
73 Set Matrix Zeroes Solution O(mn) O(1)
72 Edit Distance Solution O(m*n) O(m+n)
71 Simplify Path Solution O(n) O(n)
70 Climbing Stairs Solution O(n) O(n)
69 Sqrt(x) Solution O(logn) O(1)
68 Text Justification Solution O(n) O(1)
67 Add Binary Solution O(n) O(1)
66 Plus One Solution O(n) O(1)
65 Valid Number Solution O(n) O(1)
64 Minimum Path Sum Solution O(m*n) O(m*n)
63 Unique Paths II Solution O(m*n) O(m*n)
62 Unique Paths Solution O(m*n) O(m*n)
61 Rotate List Solution O(n) O(1)
60 Permutation Sequence Solution O(n^2) O(n)
59 Spiral Matrix II Solution O(n) O(n)
58 Length of Last Word Solution O(n) O(1)
57 Insert Intervals Solution O(n) O(1)
56 Merge Intervals Solution O(n*logn) O(1)
55 Jump Game Solution O(n) O(1)
54 Spiral Matrix Solution O(m*n) O(m*n)
53 Maximum Subarray Solution O(n) O(1)
52 N-Queens II Solution O(n!) O(n)
51 N-Queens Solution O(n!) O(n)
50 Pow(x, n) Solution O(logn) O(logn)
49 Group Anagrams Solution O(m*klogk) O(m*k)
48 Rotate Image Solution O(n^2) O(1)
47 Permutations II Solution O(n*n!) O(n)
46 Permutations Solution O(n*n!) O(n)
45 Jump Game II Solution O(n) O(1)
44 Wildcard Matching Solution O(m*n) O(m*n)
43 Multiply Strings Solution O(n) O(1)
42 Trapping Rain Water Solution O(n) O(1)
41 First Missing Positive Solution O(n) O(1)
40 Combination Sum II Solution O(k*n^k) O(k)
39 Combination Sum Solution O(k*n^k) O(k)
38 Count and Say Solution O(n*2^n) O(2^n)
37 Sudoku Solver Solution O((9!)^9) O(1)
36 Valid Sudoku Solution O(1) O(1)
35 Search Insert Position Solution O(n) O(1)
34 Search for a Range Solution O(logn) O(1)
33 Search in Rotated Sorted Array Solution O(logn) O(1)
32 Longest Valid Parentheses Solution O(n) O(n)
31 Next Permutation Solution O(n) O(1)
30 Substring with Concatenation of All Words Solution O(n^2) O(n)
29 Divide Two Integers Solution O(?) O(?)
28 Implement strStr() Solution O(n) O(1)
27 Remove Element Solution O(n) O(1)
26 Remove Duplicates from Sorted Array Solution O(n) O(1)
25 Reverse Nodes in k-Group Solution O(n) O(1)
24 Swap Nodes in Pairs Solution O(n) O(h)
23 Merge k Sorted Lists Solution O(n*logk) O(k) ๐Ÿ“บ
22 Generate Parentheses Solution TBD O(n)
21 Merge Two Sorted Lists Solution O(n) O(h)
20 Valid Parentheses Solution O(n) O(n) ๐Ÿ“บ
19 Remove Nth Node From End of List Solution O(n) O(1)
18 4 Sum Solution O(n^2) O(1)
17 Letter Combinations of a Phone Number Solution O(n*4^n) O(n)
16 3Sum Closest Solution O(nlogn) O(1)
15 3Sum Solution O(n^2) O(1) ๐Ÿ“บ
14 Longest Common Prefix Solution O(S) (S is the sum of all characters in all strings) O(1) ๐Ÿ“บ
13 Roman to Integer Solution O(1) O(1)
12 Integer to Roman Solution O(1) O(1)
11 Container With Most Water Solution O(n) O(1)
10 Regular Expression Matching Solution O(m*n) O(m*n)
9 Palindrome Number Java, C++ O(n) O(1)
8 String to Integer (atoi) Solution O(n) O(1)
7 Reverse Integer Solution O(1) O(1)
6 ZigZag Conversion Solution O(n) O(n)
5 Longest Palindromic Substring Solution O(n^2) O(1)
4 Median of Two Sorted Arrays Solution ? ?
3 Longest Substring Without Repeating Characters Solution O(n) O(k)
2 Add Two Numbers Solution O(max(m,n)) O(1)
1 Two Sum Java, C++ O(n) O(n) ๐Ÿ“บ

Database

# Title Solutions Time Space Difficulty Tag
1280 Students and Examinations Solution ๐Ÿ“บ Easy
1251 Average Selling Price Solution Easy
1179 Reformat Department Table Solution Easy
1069 Product Sales Analysis II Solution Easy
1068 Product Sales Analysis I Solution Easy
627 Swap Salary Solution Easy
626 Exchange Seats Solution Medium
620 Not Boring Movies Solution Easy
619 Biggest Single Number Solution Easy
618 Students Report By Geography Solution Hard Session Variables
615 Average Salary: Departments VS Company Solution Hard
614 Second Degree Follower Solution Medium Inner Join
613 Shortest Distance in a Line Solution Easy
612 Shortest Distance in a Plane Solution Medium
610 Triangle Judgement Solution Easy
608 Tree Node Solution Medium Union
607 Sales Person Solution Easy
603 Consecutive Available Seats Solution Easy
602 Friend Requests II: Who Has the Most Friends Solution Medium
601 Human Traffic of Stadium Solution Hard
597 Friend Requests I: Overall Acceptance Rate Solution Easy
596 Classes More Than 5 Students Solution Easy
595 Big Countries Solution O(n) O(1) Easy
586 Customer Placing the Largest Number of Orders Solution Easy
585 Investments in 2016 Solution Medium
584 Find Customer Referee Solution Easy
580 Count Student Number in Departments Solution Medium Left Join
578 Get Highest Answer Rate Question Solution Medium
577 Employee Bonus Solution Easy
574 Winning Candidate Solution Medium
571 Find Median Given Frequency of Numbers Solution Hard
570 Managers with at Least 5 Direct Reports Solution Medium
569 Median Employee Salary Solution Hard
511 Game Play Analysis I Solution Easy
262 Trips and Users Solution Hard Inner Join
197 Rising Temperature Solution O(n^2) O(n) Easy
196 Delete Duplicate Emails Solution O(n^2) O(n) Easy
185 Department Top Three Salaries Solution Hard
184 Department Highest Salary Solution O(n^2) O(n) Medium
183 Customers Who Never Order Solution O(n^2) O(n) Easy
182 Duplicate Emails Solution O(n^2) O(n) Easy
181 Employees Earning More Than Their Managers Solution O(n^2) O(n) Easy
180 Consecutive Numbers Solution O(n) O(n) Medium
178 Rank Scores Solution ? ? Medium
177 Nth Highest Salary Solution O(n) O(1) Medium
176 Second Highest Salary Solution O(n) O(1) Easy
175 Combine Two Tables Solution O(m+n) O(m+n) Easy

Shell

# Title Solutions Time Space Difficulty Tag
195 Tenth Line Solution O(n) O(1) Easy
194 Transpose File Solution O(n^2) O(n^2) Medium
193 Valid Phone Numbers Solution O(n) O(1) Easy
192 Word Frequency Solution O(n) O(k) Medium

Contributing

Your ideas/fixes/algorithms are more than welcome!

  1. Fork this repo
  2. Clone your forked repo (git clone https://github.com/YOUR_GITHUB_USERNAME/Leetcode.git) onto your local machine
  3. cd into your cloned directory, create your feature branch (git checkout -b my-awesome-fix)
  4. git add your desired changes to this repo
  5. Commit your changes (git commit -m 'Added some awesome features/fixes')
  6. Push to the branch (git push origin my-awesome-feature)
  7. Open your forked repo on Github website, create a new Pull Request to this repo!

Best way to open this project

  1. Install Intellij on your machine, either CE or UE.
  2. git clone this repo to your local disk
  3. import this project as a new project (does need to be imported as a gradle project)
  4. If you run into "Could not determine Java version using executable ..." error, use local gradle distribution: "/usr/local/Cellar/gradle/4.8.1/libexec/" instead of the default one. More details, see Stackoverflow.

About

Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.4%
  • Other 0.6%