题目You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.
Given n, find the total numb
...
题目Given a 2D board and a list of words from the dictionary, find all words in the board.
Each word must be constructed from letters of sequentially ad
...
题目A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).
The robot can only move either down or right at any
...
题目Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the ti
...
题目Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.
Example 1:
123Input: n =
...
题目Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2-&g
...
题目Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist
...
题目Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n?
Example:
12345678910Input: 3Output: 5Explanation:Given n
...
题目Given a complete binary tree, count the number of nodes.
Note:
Definition of a complete binary tree from Wikipedia:In a complete binary tree every l
...
题目Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.
Note:
Your
...