上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页
摘要: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2016-07-03 18:57 Miller1991 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
posted @ 2016-07-03 18:34 Miller1991 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-07-03 17:01 Miller1991 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-07-03 15:31 Miller1991 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
posted @ 2016-07-03 13:07 Miller1991 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2016-07-03 11:16 Miller1991 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following mat 阅读全文
posted @ 2016-07-02 14:30 Miller1991 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2016-07-01 15:54 Miller1991 阅读(141) 评论(0) 推荐(0) 编辑
摘要: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-07-01 15:34 Miller1991 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2016-07-01 14:49 Miller1991 阅读(198) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页