上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: 描述 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-05-17 14:30 larryking 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 描述 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 funct 阅读全文
posted @ 2017-05-16 18:16 larryking 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that 阅读全文
posted @ 2017-05-16 18:14 larryking 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 描述 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. 阅读全文
posted @ 2017-05-08 22:35 larryking 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and t 阅读全文
posted @ 2017-05-08 22:34 larryking 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 描述 Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the 阅读全文
posted @ 2017-05-08 22:33 larryking 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 描述 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, 阅读全文
posted @ 2017-05-08 22:06 larryking 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 描述 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 @ 2017-05-01 11:39 larryking 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 描述 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 compl 阅读全文
posted @ 2017-05-01 11:38 larryking 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 描述 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two 阅读全文
posted @ 2017-05-01 11:37 larryking 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 9 下一页