摘要:
题目: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, 阅读全文
摘要:
题目: Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Note: Length o 阅读全文
摘要:
题目: 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 a 阅读全文
摘要:
题目: 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 a 阅读全文
摘要:
题目: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Example 2: Note:Y 阅读全文
摘要:
题目: Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we 阅读全文
摘要:
题目: Count the number of prime numbers less than a non-negative number, n. Example: 分析: 统计所有小于非负整数 n 的质数的数量。 这里使用埃拉托斯特尼筛法。要得到自然数n以内的全部素数,必须把不大于√n的所有素数的 阅读全文
摘要:
题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return 阅读全文
摘要:
题目: Given a binary tree, return the postorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it itera 阅读全文
摘要:
题目: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2] 阅读全文