114. Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.
114. Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.
764. Largest Plus Sign
In a 2D grid
from (0, 0) to (N-1, N-1), every cell contains a 1
, except those cells in the given list mines
which are 0
. What is the largest axis-aligned plus sign of 1
s contained in the grid? Return the order of the plus sign. If there is none, return 0.
670. Maximum Swap
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.
127. Word Ladder
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
261. Graph Valid Tree
Given n
nodes labeled from 0
to n - 1
and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.
337. House Robber III
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the police if two directly-linked houses were broken into on the same night.
341. Flatten Nested List Iterator
Given a nested list of integers, implement an iterator to flatten it.
621. Task Scheduler
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could be done without original order. Each task could be done in one interval. For each interval, CPU could finish one task or just be idle.
139. Word Break
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words.
236. Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.
92. Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.
29. Divide Two Integers
Divide two integers without using multiplication, division and mod operator.
33. Search in Rotated Sorted Array
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.