# Introduction

## Algorithm and Data Structure Notes

\#algorithm# #datastructure# #数据结构和算法#

Problems coming from LeetCode, LintCode, TopCoder, CtCi, etc.

**Disclaimer:**

1. Under construction
2. Some solutions, comments, concepts, explanation, analysis may come from Internet, discussion forums
3. Personal use only, for learning purpose

### Contents

## Summary

* [Introduction](master)
* [Linked List](linked_list)
* [Sort List](linked_list/sort_list)
* [Merge Two Sorted Lists](linked_list/merge-two-sorted-lists)
* [Merge k Sorted Lists](heap/merge_k_sorted_lists)
* [Linked List Cycle](linked_list/linked_list_cycle)
* [Linked List Cycle II](linked_list/linked_list_cycle_ii)
* [Add Two Numbers II](linked_list/add_two_numbers_ii)
* [Add Two Numbers](linked_list/add-two-numbers)
* [Odd Even Linked List](linked_list/odd-even-linked-list)
* [Intersection of Two Linked Lists](linked_list/intersection-of-two-linked-lists)
* [Reverse Linked List](linked_list/reverse-linked-list)
* [Reverse Linked List II](linked_list/reverse-linked-list-ii)
* [Remove Linked List Elements](linked_list/remove-linked-list-elements)
* [Remove Nth Node From End of List](linked_list/remove-nth-node-from-end-of-list)
* [Middle of the Linked List](linked_list/middle-of-the-linked-list)
* [Design Linked List](linked_list/design-linked-list)
* [Design Singly Linked List](linked_list/design-linked-list/design-singly-linked-list)
* [Design Doubly Linked List](linked_list/design-linked-list/design-doubly-linked-list)
* [Palindrome Linked List](linked_list/palindrome-linked-list)
* [Remove Duplicates from Sorted List](linked_list/remove-duplicates-from-sorted-list)
* [Remove Duplicates from Sorted List II](linked_list/remove-duplicates-from-sorted-list-ii)
* [Implement Stack Using Singly Linked List](linked_list/implement-stack-using-singly-linked-list)
* [Copy List with Random Pointer](linked_list/copy-list-with-random-pointer)
* [Binary Search](binary-search)
* [Search in Rotated Sorted Array](binary-search/search-in-rotated-sorted-array)
* [Search in Rotated Sorted Array II](binary-search/search-in-rotated-sorted-array-ii)
* [Search in a Sorted Array of Unknown Size](binary-search/search-in-a-sorted-array-of-unknown-size)
* [First Bad Version](binary-search/first-bad-version)
* [Find Minimum in Rotated Sorted Array](binary-search/find-minimum-in-rotated-sorted-array)
* [Find Minimum in Rotated Sorted Array II](binary-search/find-minimum-in-rotated-sorted-array-ii)
* [Find Peak Element](binary-search/find-peak-element)
* [Search for a Range](binary-search/search-for-a-range)
* [Find K Closest Elements](binary-search/find-k-closest-elements)
* [Search Insert Position](binary-search/search-insert-position)
* [Peak Index in a Mountain Array](binary-search/peak-index-in-a-mountain-array)
* [Heaters](binary-search/heaters)
* [Hash Table](hash-table)
* [Jewels and Stones](hash-table/jewels-and-stones)
* [Single Number](hash-table/single-number)
* [Subdomain Visit Count](hash-table/subdomain-visit-count)
* [Design HashMap](hash-table/design-hashmap)
* [Design HashSet](hash-table/design-hashset)
* [Logger Rate Limiter](hash-table/logger-rate-limiter)
* [Isomorphic Strings](hash-table/isomorphic-strings)
* [Minimum Index Sum of Two Lists](hash-table/minimum-index-sum-of-two-lists)
* [Contains Duplicate II](hash-table/contains-duplicate-ii)
* [Contains Duplicate III](hash-table/contains-duplicate-iii)
* [Longest Consecutive Sequence](hash-table/longest_consecutive_sequence)
* [Valid Sudoku](hash-table/valid-sudoku)
* [Distribute Candies](hash-table/distribute-candies)
* [Shortest Word Distance](hash-table/shortest-word-distance)
* [Shortest Word Distance II](hash-table/shortest-word-distance-ii)
* [String](string)
* [Rotate String](string/rotate-string)
* [Add Binary](string/add-binary)
* [Implement strStr()](string/implement-strstr)
* [Longest Common Prefix](string/longest-common-prefix)
* [Reverse Words in a String](string/reverse-words-in-a-string)
* [Reverse Words in a String II](string/reverse-words-in-a-string-ii)
* [Reverse Words in a String III](string/reverse-words-in-a-string-iii)
* [Valid Word Abbreviation](string/valid-word-abbreviation)
* [Group Anagrams](string/group-anagrams)
* [Unique Email Addresses](string/unique-email-addresses)
* [Next Closest Time](string/next-closest-time)
* [License Key Formatting](string/license-key-formatting)
* [String to Integer - atoi](string/string-to-integer-atoi)
* [Ransom Note](string/ransom-note)
* [Multiply Strings](string/multiply-strings)
* [Text Justification](string/text-justification)
* [Reorder Log Files](string/reorder-log-files)
* [Most Common Word](string/most-common-word)
* Valid Parenthesis String
* [K-Substring with K different characters](string/k-substring-with-k-different-characters)
* [Find All Anagrams in a String](string/find-all-anagrams-in-a-string)
* [Find the Closest Palindrome](string/find-the-closest-palindrome)
* [Simplify Path](string/simplify-path)
* [Array](array)
* [Partition Array](array/partition_array)
* [Median of Two Sorted Arrays](array/median_of_two_sorted_arrays)
* [Intersection of Two Arrays](array/intersection_of_two_arrays)
* [Intersection of Two Arrays II](array/intersection_of_two_arrays_ii)
* [Maximum Subarray Sum](array/maximum_subarray_sum)
* [Minimum Subarray Sum](array/minimum-subarray-sum)
* [Maximum Subarray II](array/maximum-subarray-ii)
* [Maximum Subarray III](array/maximum-subarray-iii)
* [Subarray Sum Closest](array/subarray_sum_closest)
* [Subarray Sum](array/subarray_sum)
* [Plus One](array/plus_one)
* [Maximum Subarray Difference](array/maximum-subarray-difference)
* [Maximum Subarray IV](array/maximum-subarray-iv)
* [Subarray Sum Equals K](array/subarray-sum-equals-k)
* [Intersection of Two Arrays](array/intersection-of-two-arrays)
* [Intersection of Two Arrays II](array/intersection-of-two-arrays-ii)
* [Find Pivot Index](array/find-pivot-index)
* [Rotate Array](array/rotate-array)
* [Get Smallest Nonnegative Integer Not In The Array](array/get-smallest-nonnegative-integer-not-in-the-array)
* [Maximize Distance to Closest Person](array/maximize-distance-to-closest-person)
* [Sort Colors](array/sort-colors)
* [Next Permutation](array/next-permutation)
* [Rotate Image](array/rotate-image)
* [Pour Water](array/pour-water)
* [Prison Cells After N Days](array/active-and-inactive-cells-after-k-days)
* [Majority Element](array/majority-element)
* [Can Place Flowers](array/can-place-flowers)
* [Candy](array/candy)
* [Matrix](matrix)
* [Spiral Matrix](matrix/spiral-matrix)
* [Set Matrix Zeroes](matrix/set-matrix-zeroes)
* [Diagonal Traverse](matrix/diagonal-traverse)
* [Queue](queue)
* [Design Circular Queue](queue/design-circular-queue)
* [Implement Queue using Stacks](queue/implement-queue-using-stacks)
* [Implement Queue by Two Stacks](queue/implement_queue_by_two_stacks)
* [Implement Stack using Queues](queue/implement-stack-using-queues)
* [Moving Average from Data Stream](data_structure/moving-average-from-data-stream)
* [Walls and Gates](queue/walls-and-gates)
* [Open the Lock](queue/open-the-lock)
* [Sliding Window Maximum](data_structure/sliding_window_maximum)
* Implement Queue Using Fixed Length Array
* [Animal Shelter](data_structure/animal_shelter)
* [Stack](stack)
* [Valid Parentheses](stack/valid-parentheses)
* [Longest Valid Parentheses](stack/longest-valid-parentheses)
* [Min Stack](stack/min_stack)
* [Max Stack](stack/max-stack)
* [Daily Temperatures](stack/daily-temperatures)
* [Evaluate Reverse Polish Notation](stack/evaluate-reverse-polish-notation)
* [Next Greater Element I](stack/next-greater-element-i)
* [Next Greater Element II](stack/next-greater-element-ii)
* [Next Greater Element III](stack/next-greater-element-iii)
* [Largest Rectangle in Histogram](stack/largest_rectangle_in_histogram)
* [Maximal Rectangle](stack/maximal-rectangle)
* [Car Fleet](stack/car-fleet)
* [Heap](heap)
* [Trapping Rain Water II](heap/trapping_rain_water_ii)
* [The Skyline Problem](heap/the-skyline-problem)
* [Top K Frequent Words](heap/top-k-frequent-words)
* [Top K Frequent Words II](heap/top-k-frequent-words-ii)
* [Top K Frequent Elements](heap/top-k-frequent-elements)
* [Top k Largest Numbers](heap/top_k_largest_numbers)
* [Top k Largest Numbers II](heap/top_k_largest_numbers_ii)
* [Minimum Cost to Hire K Workers](heap/minimum-cost-to-hire-k-workers)
* [Kth Largest Element in an Array](heap/kth_largest_element)
* [Kth Smallest Number in Sorted Matrix](heap/kth_smallest_number_in_sorted_matrix)
* [Kth Smallest Sum In Two Sorted Arrays](heap/kth_smallest_sum_in_two_sorted_arrays)
* [K Closest Points to the Origin](heap/k-closest-points-to-the-origin)
* [Merge K Sorted Lists](heap/merge_k_sorted_lists)
* [Merge K Sorted Arrays](heap/merge-k-sorted-arrays)
* [Top K Frequent Words - Map Reduce](heap/top-k-frequent-words-map-reduce)
* [Data Structure & Design](data_structure)
* [Hash Function](data_structure/hash_function)
* [Heapify](data_structure/heapify)
* [LRU Cache](data_structure/lru_cache)
* [LFU Cache](data_structure/lfu_cache)
* [Rehashing](data_structure/rehashing)
* [Stack Sorting](data_structure/stack_sorting)
* [Animal Shelter](data_structure/animal_shelter)
* [Sliding Window Maximum](data_structure/sliding_window_maximum)
* [Moving Average from Data Stream](data_structure/moving-average-from-data-stream)
* [Find Median from Data Stream](data_structure/data_stream_median)
* [Sliding Window Median](data_structure/sliding-window-median)
* [Design Hit Counter](data_structure/design-hit-counter)
* [Read N Characters Given Read4 II - Call multiple times](data_structure/read-n-characters-given-read4-ii-call-multiple-times)
* [Read N Characters Given Read4](data_structure/read-n-characters-given-read4)
* [Flatten 2D Vector](data_structure/flatten-2d-vector)
* [Flatten Nested List Iterator](data_structure/flatten-nested-list-iterator)
* [Design Search Autocomplete System](trie/design-search-autocomplete-system)
* [Time Based Key-Value Store](data_structure/time-based-key-value-store)
* [Design Tic-Tac-Toe](data_structure/design-tic-tac-toe)
* [Insert Delete GetRandom O(1)](data_structure/insert-delete-getrandom-o1)
* [Union Find](union_find)
* [Find the Connected Component in the Undirected Graph](union_find/find_the_connected_component_in_the_undirected_graph)
* [Find the Weak Connected Component in the Directed Graph](union_find/find_the_weak_connected_component_in_the_directed_graph)
* [Graph Valid Tree](union_find/graph_valid_tree)
* [Number of Islands](graph_search/number_of_islands)
* [Number of Islands II](union_find/number_of_islands_ii)
* [Surrounded Regions](union_find/surrounded_regions)
* [Most Stones Removed with Same Row or Column](graph_search/most-stones-removed-with-same-row-or-column)
* [Redundant Connection](union_find/redundant-connection)
* [Trie](trie)
* [Implement Trie](trie/implement_trie)
* [Add and Search Word](trie/add_and_search_word)
* [Word Search II](trie/word_search_ii)
* [Longest Word in Dictionary](trie/longest-word-in-dictionary)
* [Palindrome Pairs](trie/palindrome-pairs)
* [Trie Serialization](trie/trie-serialization)
* [Trie Service](trie/trie-service)
* [Design Search Autocomplete System](trie/design-search-autocomplete-system)
* [Typeahead](trie/typeahead)
* [Trees](trees)
* [Binary Tree Inorder Traversal](trees/binary-tree-inorder-traversal)
* [Binary Tree Postorder Traversal](trees/binary-tree-postorder-traversal)
* [Binary Tree Preorder Traversal](trees/binary-tree-preorder-traversal)
* [Binary Tree Level Order Traversal](trees/binary-tree-level-order-traversal)
* [Binary Tree Zigzag Level Order Traversal](trees/binary-tree-zigzag-level-order-traversal)
* [Binary Tree Vertical Order Traversal](trees/binary-tree-vertical-order-traversal)
* [N-ary Tree Level Order Traversal](trees/n-ary-tree-level-order-traversal)
* [N-ary Tree Preorder Traversal](trees/n-ary-tree-preorder-traversal)
* [N-ary Tree Postorder Traversal](trees/n-ary-tree-postorder-traversal)
* [Construct Binary Tree from Preorder and Inorder Traversal](trees/construct-binary-tree-from-preorder-and-inorder-traversal)
* [Populating Next Right Pointers in Each Node](trees/populating-next-right-pointers-in-each-node)
* [Populating Next Right Pointers in Each Node II](trees/populating-next-right-pointers-in-each-node-ii)
* [Maximum Depth of Binary Tree](trees/maximum-depth-of-binary-tree)
* [Symmetric Tree](trees/symmetric-tree)
* [Validate Binary Search Tree](trees/validate-binary-search-tree)
* [Convert Sorted Array to Binary Search Tree](trees/convert-sorted-array-to-binary-search-tree)
* [Path Sum](trees/path-sum)
* [Path Sum II](trees/path-sum-ii)
* [Path Sum III](trees/path-sum-iii)
* [Binary Tree Maximum Path Sum](trees/binary-tree-maximum-path-sum)
* [Kth Smallest Element in a BST](trees/kth-smallest-element-in-a-bst)
* [Same Tree](trees/same-tree)
* [Lowest Common Ancestor of a Binary Tree](trees/lowest-common-ancestor-of-a-binary-tree)
* [Lowest Common Ancestor of a Binary Search Tree](trees/lowest-common-ancestor-of-a-binary-search-tree)
* [Nested List Weight Sum II](trees/nested-list-weight-sum-ii)
* [BST Node Distance](trees/bst-node-distance)
* [Minimum Distance (Difference) Between BST Nodes](trees/minimum-distance-difference-between-bst-nodes)
* [Closet Common Manager](trees/closet-common-manager)
* N-ary Tree Postorder Traversal
* [Serialize and Deserialize Binary Tree](trees/serialize-and-deserialize-binary-tree)
* [Serialize and Deserialize N-ary Tree](trees/serialize-and-deserialize-n-ary-tree)
* [Diameter of a Binary Tree](trees/diameter-of-a-binary-tree)
* [Print Binary Trees](trees/print-binary-trees)
* [Segment Tree](segment_tree)
* [Segment Tree Build](segment_tree/segment_tree_build)
* [Range Sum Query - Mutable](segment_tree/range-sum-query-mutable)
* [Binary Indexed Tree](binary-indexed-tree)
* [Graph & Search](graph_search)
* [Clone Graph](graph_search/clone_graph)
* [N Queens](graph_search/n_queens)
* [Six Degrees](graph_search/six_degrees)
* [Number of Islands](graph_search/number_of_islands)
* [Number of Distinct Islands](graph_search/number-of-distinct-islands)
* [Word Search](graph_search/word_search)
* [Course Schedule](graph_search/course-schedule)
* [Course Schedule II](graph_search/course-schedule-ii)
* [Word Ladder](graph_search/word-ladder)
* [Redundant Connection](graph_search/redundant-connection)
* [Redundant Connection II](graph_search/redundant-connection-ii)
* [Longest Increasing Path in a Matrix](graph_search/longest-increasing-path-in-a-matrix)
* [Reconstruct Itinerary](graph_search/reconstruct-itinerary)
* [The Maze](graph_search/the-maze)
* [The Maze II](graph_search/the-maze-ii)
* [The Maze III](graph_search/the-maze-iii)
* [Topological Sorting](graph_search/topological-sorting)
* [Island Perimeter](graph_search/island-perimeter)
* [Flood Fill](graph_search/flood-fill)
* [Cheapest Flights Within K Stops](graph_search/cheapest-flights-within-k-stops)
* [Evaluate Division](graph_search/evaluate-division)
* [Alien Dictionary](graph_search/alien-dictionary)
* [Cut Off Trees for Golf Event](graph_search/cut-off-trees-for-golf-event)
* [Jump Game II](greedy/jump-game-ii)
* [Most Stones Removed with Same Row or Column](graph_search/most-stones-removed-with-same-row-or-column)
* [Backtracking](backtracking)
* [Subsets](backtracking/subsets)
* [Subsets II](backtracking/subsets-ii)
* [Letter Combinations of a Phone Number](backtracking/letter-combinations-of-a-phone-number)
* [Permutations](backtracking/permutations)
* [Permutations II](backtracking/permutations-ii)
* [Combinations](backtracking/combinations)
* [Combination Sum](backtracking/combination-sum)
* [Combination Sum II](backtracking/combination-sum-ii)
* [Combination Sum III](backtracking/combination-sum-iii)
* [Combination Sum IV](backtracking/combination-sum-iv)
* [N-Queens](backtracking/n-queens)
* [N-Queens II](backtracking/n-queens-ii)
* [Generate Parentheses](backtracking/generate-parentheses)
* [Subsets of Size K](backtracking/subsets-of-size-k)
* [Two Pointers](two_pointers)
* [Two Sum II](two_pointers/two_sum_ii)
* [Triangle Count](two_pointers/triangle_count)
* [Trapping Rain Water](two_pointers/trapping_rain_water)
* [Container with Most Water](two_pointers/container_with_most_water)
* [Minimum Size Subarray Sum](two_pointers/minimum_size_subarray_sum)
* [Minimum Window Substring](two_pointers/minimum_window_substring)
* [Longest Substring Without Repeating Characters](two_pointers/longest_substring_without_repeating_characters)
* [Longest Substring with At Most K Distinct Characters](two_pointers/longest_substring_with_at_most_k_distinct_characters)
* [Longest Substring with At Most Two Distinct Characters](two_pointers/longest-substring-with-at-most-two-distinct-characters)
* [Fruit Into Baskets](two_pointers/fruit-into-baskets)
* [Nuts & Bolts Problem](two_pointers/nuts_and_bolts_problem)
* [Valid Palindrome](two_pointers/valid_palindrome)
* [The Smallest Difference](two_pointers/the_smallest_difference)
* [Reverse String](two_pointers/reverse-string)
* [Remove Element](two_pointers/remove-element)
* [Max Consecutive Ones](two_pointers/max-consecutive-ones)
* [Max Consecutive Ones II](two_pointers/max-consecutive-ones-ii)
* [Remove Duplicates from Sorted Array](two_pointers/remove-duplicates-from-sorted-array)
* [Remove Duplicates from Sorted Array II](two_pointers/remove-duplicates-from-sorted-array-ii)
* [Move Zeroes](two_pointers/move-zeroes)
* [Longest Repeating Character Replacement](two_pointers/longest-repeating-character-replacement)
* [3Sum With Multiplicity](two_pointers/3sum-with-multiplicity)
* [Merge Sorted Array](two_pointers/merge-sorted-array)
* [3Sum Smaller](two_pointers/3sum-smaller)
* [Backspace String Compare](two_pointers/backspace-string-compare)
* [Mathematics](mathematics)
* [Ugly Number](mathematics/ugly_number)
* [Ugly Number II](mathematics/ugly_number_ii)
* [Super Ugly Number](mathematics/super-ugly-number)
* [Sqrt(x)](mathematics/sqrt_x)
* [Random Number 1 to 7 With Equal Probability](mathematics/random-number-1-to-7-with-equal-probability)
* [Pow(x, n)](mathematics/powx-n)
* [Narcissistic Number](mathematics/narcissistic-number)
* [Rectangle Overlap](mathematics/rectangle-overlap)
* [Happy Number](mathematics/happy-number)
* [Add N Days to Given Date](mathematics/add-n-days-to-given-date)
* [Reverse Integer](mathematics/reverse-integer)
* [Greatest Common Divisor or Highest Common Factor](mathematics/greatest-common-divisor-or-highest-common-factor)
* [Bit Operation](bit-operation)
* [IP to CIDR](bit-operation/ip-to-cidr)
* [Random](random)
* [Random Pick with Weight](random/random-pick-with-weight)
* [Random Pick Index](random/random-pick-index)
* [Linked List Random Node](random/linked-list-random-node)
* [Dynamic Programming](dynamic_programming)
* [House Robber](dynamic_programming/house_robber)
* [House Robber II](dynamic_programming/house_robber_ii)
* [House Robber III](dynamic_programming/house-robber-iii)
* [Longest Increasing Continuous Subsequence](dynamic_programming/longest_increasing_continuous_subsequence)
* [Longest Increasing Continuous Subsequence II](dynamic_programming/longest_increasing_continuous_subsequence_ii)
* [Coins in a Line](dynamic_programming/coins_in_a_line)
* [Coins in a Line II](dynamic_programming/coins_in_a_line_ii)
* [Coins in a Line III](dynamic_programming/coins_in_a_line_iii)
* [Maximum Product Subarray](dynamic_programming/maximum_product_subarray)
* [Longest Palindromic Substring](dynamic_programming/longest_palindromic_substring)
* [Stone Game](dynamic_programming/stone_game)
* [Burst Balloons](dynamic_programming/burst-balloons)
* [Perfect Squares](dynamic_programming/perfect-squares)
* [Triangle](dynamic_programming/triangle)
* [Pascal's Triangle](dynamic_programming/pascals-triangle)
* [Pascal's Triangle II](dynamic_programming/pascals-triangle-ii)
* [Min Cost Climbing Stairs](dynamic_programming/min-cost-climbing-stairs)
* [Climbing Stairs](dynamic_programming/climbing-stairs)
* [Unique Paths](dynamic_programming/unique-paths)
* [Unique Paths II](dynamic_programming/unique-paths-ii)
* [Minimum Path Sum](dynamic_programming/minimum-path-sum)
* [Word Break](dynamic_programming/word-break)
* [Word Break II](dynamic_programming/word-break-ii)
* [Range Sum Query - Immutable](dynamic_programming/range-sum-query-immutable)
* [Decode Ways](dynamic_programming/decode-ways)
* [Edit Distance](dynamic_programming/edit-distance)
* [Unique Binary Search Trees](dynamic_programming/unique-binary-search-trees)
* [Unique Binary Search Trees II](dynamic_programming/unique-binary-search-trees-ii)
* [Maximal Rectangle](dynamic_programming/maximal-rectangle)
* [Maximal Square](dynamic_programming/maximal-square)
* [Regular Expression Matching ](dynamic_programming/regular-expression-matching)
* [Wildcard Matching](dynamic_programming/wildcard-matching)
* [Flip Game II](dynamic_programming/flip-game-ii)
* [Longest Increasing Subsequence](dynamic_programming/longest-increasing-subsequence)
* [Target Sum](dynamic_programming/target-sum)
* [Partition Equal Subset Sum](dynamic_programming/partition-equal-subset-sum)
* [Coin Change](knapsack_problems/coin-change)
* [Jump Game](dynamic_programming/jump-game)
* [Can I Win](minimax/can-i-win)
* [Maximum Sum Rectangle in a 2D Matrix](dynamic_programming/maximum-sum-rectangle-in-a-2d-matrix)
* [Cherry Pick](dynamic_programming/cherry-pick)
* [Knapsack](knapsack_problems)
* [Backpack](knapsack_problems/backpack)
* [Backpack II](knapsack_problems/backpack_ii)
* [Backpack III](knapsack_problems/backpack-iii)
* [Backpack IV](knapsack_problems/backpack-iv)
* [Backpack V](knapsack_problems/backpack-v)
* [Backpack VI ](knapsack_problems/backpack-vi)
* [Backpack VII](knapsack_problems/backpack-vii)
* [Coin Change](knapsack_problems/coin-change)
* [Coin Change II](knapsack_problems/coin-change-ii)
* [High Frequency](high_frequency)
* [2 Sum Closest](high_frequency/2sum_closest)
* [3 Sum](high_frequency/3sum)
* [3 Sum Closest](high_frequency/3sum_closest)
* [Sort Colors II](high_frequency/sort_colors_ii)
* [Majority Number](high_frequency/majority_number)
* [Majority Number II](high_frequency/majority_number_ii)
* [Majority Number III](high_frequency/majority_number_iii)
* [Best Time to Buy and Sell Stock](high_frequency/best_time_to_buy_and_sell_stock)
* [Best Time to Buy and Sell Stock II](high_frequency/best_time_to_buy_and_sell_stock_ii)
* [Best Time to Buy and Sell Stock III](high_frequency/best_time_to_buy_and_sell_stock_iii)
* [Best Time to Buy and Sell Stock IV](high_frequency/best_time_to_buy_and_sell_stock_iv)
* [Two Sum](high_frequency/two-sum)
* [Two Sum II - Input array is sorted](high_frequency/two-sum-ii-input-array-is-sorted)
* [Two Sum III - Data structure design](high_frequency/two-sum-iii-data-structure-design)
* [Two Sum IV - Input is a BST](high_frequency/two-sum-iv-input-is-a-bst)
* [4 Sum](high_frequency/4-sum)
* [4 Sum II](high_frequency/4-sum-ii)
* [Sorting](sorting)
* Greedy
* [Jump Game II](greedy/jump-game-ii)
* [Remove K Digits](greedy/remove-k-digits)
* Minimax
* [Nim Game](minimax/nim-game)
* [Can I Win](minimax/can-i-win)
* [Sweep Line & Interval](sweep-line)
* [Meeting Rooms](sweep-line/meeting-rooms)
* [Meeting Rooms II](sweep-line/meeting-rooms-ii)
* [Merge Intervals](sweep-line/merge-intervals)
* [Insert Interval](sweep-line/insert-interval)
* [Number of Airplanes in the Sky](sweep-line/number_of_airplanes_in_the_sky)
* [Exam Room](sweep-line/exam-room)
* [Employee Free Time](sweep-line/employee-free-time)
* [Closest Pair of Points](sweep-line/closest-pair-of-points)
* [My Calendar I](sweep-line/my-calendar-i)
* [My Calendar II](sweep-line/my-calendar-ii)
* [My Calendar III](sweep-line/my-calendar-iii)
* [Add Bold Tag in String](sweep-line/add-bold-tag-in-string)
* [Other Algorithms and Data Structure](other-algorithms-and-data-structure)
* [Huffman Coding](other-algorithms-and-data-structure/huffman-coding)
* [Reservoir Sampling](other-algorithms-and-data-structure/reservoir-sampling)
* [Bloom Filter](other-algorithms-and-data-structure/bloom-filter)
* [External Sorting](other-algorithms-and-data-structure/external-sorting)
* [Construct Quad Tree](other-algorithms-and-data-structure/construct-quad-tree)
* [Company Tag](company-tag)
* [Google](company-tag/google)
* [Guess the Word](company-tag/google/guess-the-word)
* [Raindrop on Sidewalk](company-tag/google/raindrop-on-sidewalk)
* Airbnb
* [Display Pages (Pagination)](company-tag/airbnb/display-pages)
* Amazon
* [Problem Solving Summary ](problem-solving-summary)
* [String or Array Rotation](problem-solving-summary/string-rotation)
* [Tips for Avoiding Bugs ](problem-solving-summary/tips-for-avoiding-bugs)
* [Substring or Subarray Search](problem-solving-summary/substring-or-subarray-search)
* [Sliding Window](problem-solving-summary/sliding-window)
* [K Sums](problem-solving-summary/k-sums)
* [Combination Sum Series](problem-solving-summary/combination-sum-series)
* Knapsack Problems
* [Depth-first Search](problem-solving-summary/depth-first-search)
* [Large Number Operation](problem-solving-summary/large-number-operation)
* [Implementation - Simulation](problem-solving-summary/implementation-simulation)
* [Monotonic Stack & Queue](problem-solving-summary/monotonic-stack)
* [Top K Problems](problem-solving-summary/top-k-problems)
* [Java Interview Tips](problem-solving-summary/java-interview-tips)
* [OOP in Java](problem-solving-summary/java-interview-tips/oop-in-java)
* [Conversion in Java](problem-solving-summary/java-interview-tips/conversion-in-java)
* [Data Structures in Java](problem-solving-summary/java-interview-tips/data-structures-in-java)
* [Algorithm Optimization Tips](problem-solving-summary/algorithm-optimization-tips)
* [Reference](reference)
