- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 LeetCode解题报告 55. Jump Game [medium]
题目描述Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2016-12-30 15:06:15 221
原创 LeetCode解题报告 199. Binary Tree Right Side View [medium]
题目描述Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tre
2016-12-24 00:39:02 273
原创 LeetCode解题报告 383. Ransom Note [easy]
题目描述Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the maga
2016-12-23 01:05:13 229
原创 LeetCode解题报告 344. Reverse String [easy]
题目要求Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".解题思路逆转一个字符串,注意空格就行。复杂度分析时间复杂度O(n)。代码如下:cla
2016-12-23 01:02:06 275
原创 LeetCode解题报告 445. Add Two Numbers II [medium]
题目描述You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and return it
2016-12-23 00:07:57 732
原创 LeetCode解题报告 349. Intersection of Two Arrays [easy]
题目描述Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be uniq
2016-12-21 00:49:42 366
原创 LeetCode解题报告 394. Decode String [medium]
题目描述Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note
2016-12-20 10:03:55 263
原创 LeetCode解题报告 108. Convert Sorted Array to Binary Search Tree [medium]
题目描述Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路题目要求对一个已经排好序的数组来构造一颗平衡二叉树。平衡二叉树指的是对于树上任意一个节点,其左右子树的高度差不超过1。若两颗子树节点数量相同,且使用同
2016-12-20 00:44:38 205
原创 LeetCode解题报告 452. Minimum Number of Arrows to Burst Balloons [medium]
题目描述There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y
2016-12-18 01:02:21 368
原创 LeetCode解题报告 279. Perfect Squares [medium]
题目描述Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4;
2016-12-17 00:52:52 582
原创 LeetCode解题报告 120. Triangle [medium]
题目描述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 following triangle[ [2], [
2016-12-03 15:07:46 353
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人