record code and solutions on leetcode
- 274 H-Index
- 275 H-Index II
- 388 Longest Absolute File Path
- 705 Design HashSet
- 706 Design HashMap
- 745 Prefix and Suffix Search
- 888 Fair Candy Swap
- 890 Find and Replace Pattern
- 10 Regular Expression Matching
- 120 Triangle
- 474 Ones and Zeroes
- 583 Delete Operation for Two Strings
- 664 Strange Printer
- 688 Knight Probability in Chessboard
- 691 Stickers to Spell Word
- 712 Minimum ASCII Delete Sum for Two Strings
- 730 Count Different Palindromic Subsequences(cache + DP)
- 741 Cherry Pickup(cache + DP)
- 764 Largest Plus Sign
- 790 Domino and Tromino Tiling
- 808 Soup Servings
- 813 Largest Sum of Averages
- 818 Race Car
- 823 Binary Trees With Factors
- 887 Super Egg Drop
- 894 All Possible Full Binary Trees
- 898 Bitwise ORs of Subarrays
- 903 Valid Permutations for DI Sequence
- 920 Number of Music Playlists
- 1143 Longest Common Subsequence
- 821 Shortest Distance to a Character
- 837 New 21 Game
- 873 Length of Longest Fibonacci Subsequence
- 877 Stone Game
- 89 Gray Code
- 292 Nim Game
- 306 Additive Number
- 419 Battleships in a Board
- 427 Construct Quad Tree
- 526 Beautiful Arrangement
- 3 Longest Substring Without Repeating Characters
- 42 Trapping Rain Water
- 19 Remove Nth Node From End of List
- 61 Rotate List
- 86 Partition List
- 141 Linked List Cycle
- 142 Linked List Cycle 2
- 234 Palindrome Linked List
- 344 Reverse String
- 345 Reverse Vowels of a String(re.sub)
- 424 Longest Repeating Character Replacement
- 452 Minimum Number of Arrows to Burst Balloons
- 457 Circular Array Loop
- 524 Longest Word in Dictionary through Deleting
- 567 Permutation in String
- 763 Partition Labels
- 777 Swap Adjacent in LR String
- 809 Expressive Words
- 826 Most Profit Assigning Work
- 828 Unique Letter String
- 838 Push Dominoes
- 845 Longest Mountain in Array
- 881 Boats to Save People
- 904 Fruit into Baskets
- 992 Subarrays with K Different Integers
- 930 Binary Subarrays With Sum
- 1004 Max Consecutive Ones III
- 1234 Replace the Substring for Balanced String
- 1248 Count Number of Nice Subarrays
- 874 Walking Robot Simulation
- 90 Subsets II
- 130 Surrounded Regions(BFS)
- 279 Perfect Squares(minimum suited condition)
- 429 N-ary Tree Level Order Traversal
- 433 Minimum Genetic Mutation
- 440 K-th Smallest in Lexicographical Order
- 749 Contain Virus
- 773 Sliding Puzzle
- 815 Bus Routes
- 847 Shortest Path Visiting All Nodes
- 854 K-Similar Strings
- 46 Permutations
- 51 N Queens
- 52 N Queens ii
- 77 Combinations
- 93 Restore IP Addresses
- 109 Convert Sorted List to Binary Search Tree(how to find middle of a tree)
- 200 Number of Islands
- 301 Remove Invalid Parentheses
- 329 Longest Increasing Path in a Matrix(DP + DFS + Memoization)
- 386 Lexicographical Numbers
- 401 Binary Watch
- 417 Pacific Atlantic Water Flow
- 473 Matchsticks to Square
- 488 Zuma Game
- 491 Increasing Subsequences(Tuple instead of list)
- 529 Minesweeper
- 530 Minimum Absolute Difference in BST(Inorder for BST)
- 542 01 Matrix
- 547 Friend Circles(Union Find)
- 559 Maximum Depth of N-ary Tree
- 698 Partition to K Equal Sum Subsets
- 721 Accounts Merge
- 733 Flood Fill
- 756 Pyramid Transition Matrix
- 784 Letter Case Permutation
- 785 Is Graph Bipartite
- 797 All Paths From Source to Target(iterative DFS)
- 802 Find Eventual Safe States
- 803 Bricks Falling When Hit
- 827 Making A Large Island
- 841 Keys and Rooms
- 851 Loud and Rich
- 916 Word Subsets
- 239 Sliding Window Maximum
- 264 Ugly Number II
- 347 Top K Frequent Elements
- 480 Sliding Window Median
- 313 Super Ugly Number
- 373 Find K Pairs with Smallest Sums
- 407 Trapping Rain Water II
- 502 IPO(Greedy)
- 506 Relative Ranks
- 703 Kth Largest Element in a Stream(heappushpop)
- 743 Network Delay Time
- 767 Reorganize String
- 871 Minimum Number of Refueling Stops
- 857 Minimum Cost to Hire K Workers
- 692 Top K Frequent Words
- 891 Sum of Subsequence Widths
- 84 Largest Rectangle in Histogram
- 85 Maximal Rectangle
- 227 Basic Calculator II
- 678 Valid Parenthesis String
- 907 Sum of Subarray Minimums
- 2 Add Two Numbers
- 12 Integer to Roman
- 13 Roman to Integer
- 29 Divide Two Integers
- 50 Pow(x,n)
- 60 Permutation Sequence
- 67 Add Binary
- 69 Sqrt(x)
- 137 Single Number II
- 168 Excel Sheet Column Title
- 171 Excel Sheet Column Number
- 172 Factorial Trailing Zeroes
- 223 Rectangle Area
- 233 Number of Digit One
- 258 Add Digits
- 263 Ugly Number
- 319 Bulb Switcher
- 326 Power of Three
- 335 Self Crossing
- 365 Water and Jug Problem
- 367 Valid Perfect Square
- 372 Super Pow
- 390 Elimination Game
- 391 Perfect Rectangle
- 396 Rotate Function
- 400 Nth Digit
- 420 Strong Password Checker
- 423 Reconstruct Original Digits from English
- 441 Arranging Coins
- 453 Minimum Moves to Equal Array Elements
- 458 Poor Pigs
- 462 Minimum Moves to Equal Array Elements II
- 470 Implement Rand10() Using Rand7()(Rejective Sampling/RandN -> RandM)
- 481 Magical String
- 492 Construct the Rectangle
- 507 Perfect Number
- 509 Fibonacci Number
- 537 Complex Number Multiplication
- 553 Optimal Division
- 556 Next Greater Element III(the next permutation)
- 592 Fraction Addition and Subtraction(next的活用)
- 593 Valid Square
- 598 Range Addition II
- 633 Sum of Square Numbers
- 640 Solve the Equation
- 672 Bulb Switcher II
- 679 24 Game
- 754 Reach a Number
- 779 K-th Symbol in Grammar
- 780 Reaching Points
- 788 Rotated Digits
- 789 Escape The Ghosts
- 805 Split Array With Same Average
- 812 Largest Triangle Area
- 822 Card Flipping Game
- 829 Consecutive Numbers Sum
- 836 Rectangle Overlap
- 902 Numbers At Most N Given Digit Set
- 861 Score After Flipping Matrix
- 869 Reordered Power of 2
- 878 Nth Magical Number
- 6 ZigZag Conversion
- 7 Reverse Integer
- 8 String to Integer (atoi)
- 14 Longest Common Prefix
- 17 Letter Combinations of a Phone Number
- 22 Generate Parentheses
- 38 Count and Say(itertools.groupby)
- 43 Multiply Strings
- 58 Length of Last World
- 65 Valid Number(DFA)
- 68 Text Justification
- 151 Reverse Words in a String
- 165 Compare Version Numbers
- 214 Shortest Palindrome(KMS)
- 273 Integer to English Words
- 383 Ransom Note(collections.Counter)
- 412 Fizz Buzz
- 415 Add Strings
- 434 Number of Segments in a String
- 443 String Compression
- 459 Repeated Substring Pattern
- 468 Validate IP Address
- 482 License Key Formatting
- 504 Base 7(Base 7)
- 395 Longest Substring with At Least K Repeating Characters
- 520 Detect Capital
- 521 Longest Uncommon Subsequence I
- 522 Longest Uncommon Subsequence II(ALL - all)
- 539 Minimum Time Difference
- 541 Reverse String II
- 557 Reverse Words in a String III
- 657 Robot Return to Origin
- 686 Repeated String Match
- 696 Count Binary Substrings
- 709 To Lower Case
- 728 Self Dividing Numbers
- 738 Monotone Increasing Digits
- 791 Custom Sort String
- 804 Unique Morse Code Words
- 806 Number of Lines To Write String
- 807 Max Increase to Keep City Skyline(transpose of matrix)
- 816 Ambiguous Coordinates
- 819 Most Common Word(collections.Counter.most_common(1)[0][0])
- 820 Short Encoding of Words
- 824 Goat Latin
- 831 Masking Personal Information(string.find)
- 833 Find And Replace in String
- 842 Split Array into Fibonacci Sequence
- 859 Buddy Strings
- 880 Decoded String at Index
- 884 Uncommon Words from Two Sentences
- 899 Orderly Queue
- 21 Merge Two Sorted Lists
- 24 Swap Nodes in Pairs(swap linked list nodes)
- 25 Reverse Nodes in k-Group(reverse a list)
- 82 Remove Duplicates from Sorted List ii
- 83 Remove Duplicates from Sorted List
- 92 Reverse Linked List II
- 143 Reorder List(reverse and merge lists)
- 147 Insertion Sort List
- 148 Sort List(merge sort)
- 160 Intersection of Two Linked Lists
- 203 Remove Linked List Elements
- 206 Reverse Linked List(Standard Reverse)
- 328 Odd Even Linked List
- 430 Flatten a Multilevel Doubly Linked List
- 445 Add Two Numbers II
- 725 Split Linked List in Parts(分段方法 chunk)
- 817 Linked List Components
- 876 Middle of the Linked List
- 125 Valid Palindrome
- 8 Palindrome Number
- 564 Find the Closest Palindrome
- 680 Valid Palindrome II
- 866 Prime Palindrome
- 906 Super Palindromes
- 134 Gas Station(solution condition)
- 135 Candy(two scan)
- 321 Create Maximum Number
- 330 Patching Array
- 406 Queue Reconstruction by Height(sort & insert)
- 435 Non-overlapping Intervals
- 455 Assign Cookies
- 630 Course Schedule III(General type)
- 659 Split Array into Consecutive Subsequences(General type)
- 753 Cracking the Safe
- 757 Set Intersection Size At Least Two
- 765 Couples Holding Hands
- 778 Swim in Rising Water
- 846 Hand of Straights
- 860 Lemonade Change
- 146 LRU Cache(collections.OrderedDict)
- 208 Implement Trie (Prefix Tree)
- 211 Add and Search Word - Data structure design
- 284 Peeking Iterator
- 295 Find Median from Data Stream(two heap)
- 307 Range Sum Query - Mutable(Binary Index Tree)
- 384 Shuffle an Array(random.shuffle)
- 710 Random Pick with Blacklist(Remap)
- 715 Range Module
- 41 First Missing Positive
- 56 Merge Intervals
- 164 Maximum Gap(bucket sorting)
- 179 Largest Number(Comparable, python.sort())
- 215 Kth Largest Element in an Array(Quick Select)
- 220 Contains Duplicate III(Bucket Sorting)
- 268 Missing Number
- 287 Find the Duplicate Number
- 315 Count of Smaller Numbers After Self
- 324 Wiggle Sort II(Virtual Index)
- 327 Count of Range Sum(Binary Search Tree, bisect)
- 493 Reverse Pairs(Merge Sort for pairs)
- 870 Advantage Shuffle
- 896 Monotonic Array
- 912 Sort an Array
- 175 Combine Two Tables
- 176 Second Highest Salary
- 177 Nth Highest Salary
- 178 Rank Scores
- 180 Consecutive Numbers(Variables)
- 190 Reverse Bits
- 191 Number of 1 Bits
- 201 Bitwise AND of Numbers Range
- 231 Power of Two
- 260 Single Number III(XOR find diff)
- 318 Maximum Product of Word Lengths(character not same)
- 342 Power of Four
- 393 UTF-8 Validation
- 397 Integer Replacement
- 405 Convert a Number to Hexadecimal
- 421 Maximum XOR of Two Numbers in an Array
- 461 Hamming Distance(bin)
- 476 Number Complement
- 477 Total Hamming Distance(Hamming Distance)
- 693 Binary Number with Alternating Bits(bin)
- 762 Prime Number of Set Bits in Binary Representation
- 868 Binary Gap
- 207 Course Schedule(BFS + DFS + Topological Sorting)
- 210 Course Schedule II(Topological Sorting on Youtube)
- 310 Minimum Height Trees(BFS + Leaves)
- 332 Reconstruct Itinerary(DFS + Greedy Eulerian Path)
- 399 Evaluate Division
- 882 Reachable Nodes In Subdivided Graph
- 886 Possible Bipartition
- 33 Search in Rotated Sorted Array
- 153 Find Minimum in Rotated Sorted Array
- 240 Search a 2D Matrix II(Bi-Binary-Search)
- 278 First Bad Version
- 300 Longest Increasing Subsequence
- 334 Increasing Triplet Subsequence
- 352 Data Stream as Disjoint Intervals
- 436 Find Right Interval
- 475 Heaters
- 540 Single Element in a Sorted Array
- 658 Find K Closest Elements
- 668 Kth Smallest Number in Multiplication Table
- 704 Binary Search
- 744 Find Smallest Letter Greater Than Target
- 786 K-th Smallest Prime Fraction
- 852 Peak Index in a Mountain Array
- 875 Koko Eating Bananas
105 Construct Binary Tree from Preorder and Inorder Traversal 106 Construct Binary Tree from Inorder and Postorder Traversal
- 589 N-ary Tree Preorder Traversal
- 590 N-ary Tree Postorder Traversal
- 783 Minimum Distance Between BST Nodes
- 872 Leaf-Similar Trees(yield)
- 889 Construct Binary Tree from Preorder and Postorder Traversal
- 897 Increasing Order Search Tree
- 919 Complete Binary Tree Inserter
- 4 Median of Two Sorted Arrays
- NSUM
- Merge k Sorted Lists
- 53 Maximum Subarray
- 76 Minimum Window Substring
- Tree Traversal
- 96 Unique Binary Search Trees
- Permutation
- 371 Sum of Two Integers(bit manipulation)
- 498 Diagonal Traverse
- A* algorithm + BFS + Dijkstra(675 Cut Off Trees for Golf Event)
- 209 Minimum Size Subarray Sum