Given a linked list and a value x, partition it such that all nodes less than x come before nod…
LeetCode | Decode Ways(译码方式)
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -…
LeetCode | Scramble String(字符交换)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings re…
LeetCode | Recover Binary Search Tree(恢复二叉搜索树)
wo elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its struct…
LeetCode | Restore IP Addresses(恢复ip地址)
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For…
LeetCode | Best Time to Buy and Sell Stock III(股票购买抛售问题III)
Say you have an array for which the ith element is the price of a given stock on day i. Design …
LeetCode | Word Ladder II(单词梯II)
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from…
LeetCode | Word Ladder(单词梯)
Given two words (start and end), and a dictionary, find the length of shortest transformation sequen…
LeetCode | Surrounded Regions(包围的区域)
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region i…
LeetCode | Clone Graph(克隆图)
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.…