c++
文章平均质量分 61
女侠楚楚楚
这个作者很懒,什么都没留下…
展开
-
69. Sqrt(x)【leetcode解题报告】
descriptionImplement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are trunc...原创 2018-04-30 11:18:08 · 177 阅读 · 0 评论 -
347. Top K Frequent Elements【leetcode解题报告】
题目Given a non-empty array of integers, return the k most frequent elements.For example, Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number of u...原创 2018-04-28 22:02:39 · 132 阅读 · 0 评论 -
264. Ugly Number II【 leetcode解题报告】
DescriptionWrite a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of t...原创 2018-05-07 14:27:39 · 229 阅读 · 0 评论 -
215. Kth Largest Element in an Array 【leetcode解题报告】
题目: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For example, Given [3,2,1,5,6,4] and k = 2, ...原创 2018-04-28 20:22:39 · 188 阅读 · 0 评论 -
4. Median of Two Sorted Arrays【Hard】
leetcode Median of Two Sorted Arrays hard原创 2018-04-21 18:30:21 · 146 阅读 · 0 评论 -
Single Number Ⅰ Ⅱ III【 leetcode解题报告】
136. Single Number ⅠDescriptionGiven a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexi...原创 2018-05-01 14:48:43 · 476 阅读 · 0 评论 -
209. Minimum Size Subarray Sum【leetcode解题报告】
DescriptionGiven an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, ...原创 2018-04-30 19:14:30 · 190 阅读 · 0 评论 -
81. Search in Rotated Sorted Array II【leetcode解题报告】
DescriptionSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]).You are given a target value to sear...原创 2018-04-30 17:07:23 · 201 阅读 · 0 评论 -
33. Search in Rotated Sorted Array【leetcode解题报告】
DescriptionSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to sear...原创 2018-04-30 17:06:57 · 362 阅读 · 0 评论 -
367. Valid Perfect Square【leetcode解题报告】
题目Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt.Example 1:Input: 16Retu...原创 2018-04-30 15:08:45 · 128 阅读 · 0 评论 -
378. Kth Smallest Element in a Sorted Matrix【leetcode解题报告】
题目Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, n...原创 2018-04-28 22:32:14 · 182 阅读 · 0 评论