摘要:
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
摘要:
Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space 阅读全文
摘要:
声明3行4列的数组 cpp const int m = 3, n = 4; vector A(m); // 3 rows for(int i = 0; i 阅读全文
摘要:
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 p 阅读全文
摘要:
学DP, 从这里开始吧: http://mp.weixin.qq.com/s/0AgJmQNYAKzVOyigXiKQhA 阅读全文
摘要:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given , The longest consecutive elemen 阅读全文
摘要:
有一个升序排序的数组. For example, Given sorted array , Your function should return length = , with the first five elements of nums being . It doesn't matter wh 阅读全文
摘要:
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., might become ). Write a function to determine if 阅读全文
摘要:
Given an integer $n$, generate a square matrix filled with elements from 1 to $n^2$ in spiral order. For example, Given n = 3, You should return the f 阅读全文