摘要: 题目: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, 阅读全文
posted @ 2019-10-20 18:49 silentteller 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Note: Length o 阅读全文
posted @ 2019-10-14 23:11 silentteller 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2019-10-11 22:15 silentteller 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2019-10-11 20:25 silentteller 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2019-10-11 19:19 silentteller 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2019-09-11 16:48 silentteller 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 题目: Count the number of prime numbers less than a non-negative number, n. Example: 分析: 统计所有小于非负整数 n 的质数的数量。 这里使用埃拉托斯特尼筛法。要得到自然数n以内的全部素数,必须把不大于√n的所有素数的 阅读全文
posted @ 2019-09-11 16:05 silentteller 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 阅读全文
posted @ 2019-07-11 20:07 silentteller 阅读(757) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, return the postorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it itera 阅读全文
posted @ 2019-07-11 18:33 silentteller 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 题目: 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] 阅读全文
posted @ 2019-07-10 16:37 silentteller 阅读(253) 评论(0) 推荐(0) 编辑