- 博客(5)
- 资源 (2)
- 收藏
- 关注
原创 Best Time to Buy and Sell Stock III - LeetCode 123
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 at most two transactions.Note:You may not
2015-10-10 15:41:09 719
原创 Perfect Squares - LeetCode 279
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 =
2015-10-05 16:41:13 462
原创 Missing Number - LetcCode 268
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm should ru
2015-10-05 15:56:14 476
原创 Product of Array Except Self - LeetCode 238
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n
2015-10-04 23:08:05 387
原创 Gas Station - LeetCode 134
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 it
2015-10-03 22:53:10 407
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人