2016年8月26日

【LeetCode】121. Best Time to Buy and Sell Stock 解题小结

摘要: 题目: 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 transac 阅读全文

posted @ 2016-08-26 17:49 医生工程师 阅读(110) 评论(0) 推荐(0) 编辑

【LeetCode】283. Move Zeroes 解题小结

摘要: 题目: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, 阅读全文

posted @ 2016-08-26 16:51 医生工程师 阅读(110) 评论(0) 推荐(0) 编辑

【LeetCode】119. Pascal's Triangle II QuestionEditorial Solution 解题小结

摘要: 题目: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. 思路大概是一步一步从后往前算出每行的各个元素。 阅读全文

posted @ 2016-08-26 15:33 医生工程师 阅读(139) 评论(0) 推荐(0) 编辑

【LeetCode】26. Remove Duplicates from Sorted Array 解题小结

摘要: 题目: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra spac 阅读全文

posted @ 2016-08-26 05:19 医生工程师 阅读(108) 评论(0) 推荐(0) 编辑

导航