上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页
摘要: 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 @ 2017-08-29 06:55 Jimmy_Cheng 阅读(154) 评论(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 阅读全文
posted @ 2017-08-29 05:51 Jimmy_Cheng 阅读(184) 评论(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 @ 2017-08-28 11:08 Jimmy_Cheng 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us 阅读全文
posted @ 2017-08-27 11:43 Jimmy_Cheng 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 阅读全文
posted @ 2017-08-27 11:06 Jimmy_Cheng 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 题目标签:Array, 阅读全文
posted @ 2017-08-27 09:18 Jimmy_Cheng 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. 题目标签:Array, T 阅读全文
posted @ 2017-08-27 07:20 Jimmy_Cheng 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplicate sub 阅读全文
posted @ 2017-08-26 07:58 Jimmy_Cheng 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size tha 阅读全文
posted @ 2017-08-02 04:09 Jimmy_Cheng 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose an arra 阅读全文
posted @ 2017-08-02 00:11 Jimmy_Cheng 阅读(233) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 27 下一页