2017年6月11日

(leetcode题解)Two Sum II - Input array is sorted

摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文

posted @ 2017-06-11 22:43 kiplove 阅读(165) 评论(0) 推荐(0) 编辑

(leetcode题解)Pascal's Triangle

摘要: Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 题意实现一个杨辉三角。 这道题只要注意了边界条件应该很好实现 阅读全文

posted @ 2017-06-11 22:06 kiplove 阅读(155) 评论(0) 推荐(0) 编辑

(leetcode题解)Shortest Unsorted Continuous Subarray

摘要: Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be 阅读全文

posted @ 2017-06-11 21:21 kiplove 阅读(259) 评论(0) 推荐(0) 编辑

(leetcode题解)Max Consecutive Ones

摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length 阅读全文

posted @ 2017-06-11 20:18 kiplove 阅读(185) 评论(0) 推荐(0) 编辑

(leetcode题解)Third Maximum Number

摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi 阅读全文

posted @ 2017-06-11 19:59 kiplove 阅读(141) 评论(0) 推荐(0) 编辑

导航