上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 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 increasing subsequence is [2, 3, 7, 101], therefore t... 阅读全文
posted @ 2016-01-14 11:01 dylqt 阅读(182) 评论(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 matrix:1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Retur... 阅读全文
posted @ 2016-01-13 12:07 dylqt 阅读(220) 评论(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 following triangle[ [2], [3,4], [6,5,7],... 阅读全文
posted @ 2016-01-11 11:28 dylqt 阅读(202) 评论(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 complete as many transactions as you like (ie, buy one a... 阅读全文
posted @ 2016-01-10 18:39 dylqt 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at an... 阅读全文
posted @ 2016-01-10 15:10 dylqt 阅读(144) 评论(0) 推荐(0) 编辑
摘要: A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta... 阅读全文
posted @ 2016-01-07 16:33 dylqt 阅读(124) 评论(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 need to make up that amount. If that amount of money ... 阅读全文
posted @ 2016-01-04 14:14 dylqt 阅读(220) 评论(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, return 3 because 12 = 4 + 4 + 4; given n = 13, re... 阅读全文
posted @ 2015-12-27 11:52 dylqt 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), de... 阅读全文
posted @ 2015-12-26 11:17 dylqt 阅读(150) 评论(0) 推荐(0) 编辑
摘要: There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its n... 阅读全文
posted @ 2015-12-26 09:58 dylqt 阅读(221) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页