原创 [LeetCode] 123. Best Time to Buy and Sell Stock III

Best Time to Buy and Sell Stock III Say you have an array for which the ith element is the price of a given stock o

原创 [leetcode] 152. Maximum Product Subarray

Maximum Product Subarray Given an integer array nums, find the contiguous subarray within an array (containing at l

原创 [leetcode] 115. Distinct Subsequences

Distinct Subsequences Given a string S and a string T, count the number of distinct subsequences of S which equals

原创 [leetcode] 139. Word Break

Word Break Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if

原创 [leetcode] 130. Surrounded Regions

Surrounded Regions Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’. A

原创 [leetcode] 131. Palindrome Partitioning

Palindrome Partitioning Given a string s, partition s such that every substring of the partition is a palindrome. R

原创 [leetcode] 149. Max Points on a Line

Max Points on a Line Given n points on a 2D plane, find the maximum number of points that lie on the same straight

原创 [leetcode] 128. Longest Consecutive Sequence

Longest Consecutive Sequence Given an unsorted array of integers, find the lengt h of the longest consecutive elem

原创 [leetcode] 132.Palindrome Partitioning II

Palindrome Partitioning II Given a string s, partition s such that every substring of the partition is a palindrome

原创 [leetcode] 127. Word Ladder

Word Ladder Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest tran

原创 [leetcode] 135. Candy

Candy There are N children standing in a line. Each child is assigned a rating value. You are giving candies to the

原创 [leetcode] 97. Interleaving String

Interleaving String Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input

原创 [leetcode] 87. Scramble String

Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substri

原创 [leetcode] 221. Maximal Square && 85. Maximal Rectangle

Maximal Square Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and re

原创 [LeetCode] 93. Restore IP Addresses

Restore IP Addresses Given a string containing only digits, restore it by returning all possible valid IP address c