/leetcode

Primary LanguagePython

two pointer

  • 11 Container With Most Water
  • 42 Trapping Rain Water

Monoqueue

Monoqueue can be used to get the extremum in parts of an array.

  • 239 Sliding Window Maximum

Sort

    1. Most Profit Assigning Work Binary Search
  • 4 Median of Two Sorted Arrays
  • 23 Merge k Sorted Lists
  • 33 Search in Rotated Sorted Array
  • 81 Search in Rotated Sorted Array II
  • 124 Binary Tree Maximum Path Sum
  • 240 Search a 2D Matrix II
  • 540 Single Element in a Sorted Array

Quick Sort

  • 75 Sort Colors
  • 56 Merge Intervals
  • 962 Maximum Width Ramp

Merge Sort

  • 148 Sort List
  • 56 Merge Intervals

Topological Sort

  • 207 Course Schedule
  • 210 Course Schedule II 210CourseScheduleII.py

Heap Sort

  • 692 Top K Frequent Words 692TopKFrequentWords.py

DP

    1. Profitable Schemes
  • 1074 Number of Submatrices That Sum to Target
  • 1015 Smallest Integer Divisible by K
  • 152 Maximum Product Subarray
  • 84 Largest Rectangle in Histogram
  • 72 Edit Distance
  • 139 Word Break
  • 10 Regular Expression Matching
  • 377 Combination Sum IV
  • 491 Increasing Subsequences
  • 646 Maximum Length of Pair Chain
  • 1027 Longest Arithmetic Sequence
  • 123 Best Time to Buy and Sell Stock III
  • 188 Best Time to Buy and Sell Stock IV
  • 689 Maximum Sum of 3 Non-Overlapping Subarrays
  • 823 Binary Trees With Factors
  • 410 Split Array Largest Sum
  • 494 Target Sum 494TargetSum.py

Prie

  • 820 Short Encoding of Words

Tranversal

  • 79 Word Search: how to prune useless branches is importanct to find the solution
  • 53 Maximum Subarray
  • 236 Lowest Common Ancestor of a Binary Tree
  • 222 Count Complete Tree Nodes
  • 773 Sliding Puzzle

Binary Tree:

  • 105 Construct Binary Tree from Preorder and Inorder Traversal
  • 98 Validate Binary Search Tree
  • 114 Flatten Binary Tree to Linked List
  • 117 Populating Next Right Pointers in Each Node II
  • 173 Binary Search Tree Iterator
  • 110 Balanced Binary Tree
  • BFS
    • 116 Populating Next Right Pointers in Each Node
    • 623AddOneRowtoTree
  • DFS
      1. Sum of Root To Leaf Binary Numbers

Linked List

  • 234 Palindrome Linked List
  • 203 Remove Linked List Elements

Sliding Window

  • 76 Minimum Window Substring
  • 209 Minimum Size Subarray Sum
  • 567 Permutation in String

Greedy

  • 948 Bag of Tokens
  • 646 Maximum Length of Pair Chain
  • 870 Advantage Shuffle

Cyclic Swapping

  • 268 Missing Number
  • 41 First Missing Positive

Graph

  • 127 Word Ladder
  • 743 Network Delay Time
  • 787 Cheapest Flights Within K Stops
  • 126 Word Ladder II
  • 685 Redundant Connection II
  • 684 Redundant Connection

Union Find

  • 547 Friend Circles

Math

  • 453 Minimum Moves to Equal Array Elements
  • 462 Minimum Moves to Equal Array Elements II

Bitwise

  • 137 Single Number II

String

    1. Repeated String Match
    1. Longest Duplicate Substring
  • 686 Repeated String Match