Problem:
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and...
分类:
编程语言 时间:
2015-05-08 00:05:11
阅读次数:
129
https://leetcode.com/problems/jump-game/Given an array of non-negative integers, you are initially positioned at the first index of the array.Each ele...
分类:
其他好文 时间:
2015-05-07 23:43:45
阅读次数:
125
Add Two NumbersTotal Accepted:58510Total Submissions:268082My SubmissionsQuestionSolutionYou are given two linked lists representing two non-negative ...
分类:
其他好文 时间:
2015-05-07 21:59:52
阅读次数:
96
题目描述Count the number of prime numbers less than a non-negative number, n。本题要求我们求出小于n的数中共有多少个质数。相信大部分同学在刚开始学习C语言的时候估计都写过判断一个数为质数的程序。一般的思路为:bool isPrime(int num) {
int s = sqrt(num) + 1;
for( i...
分类:
其他好文 时间:
2015-05-07 16:46:37
阅读次数:
91
题目描述:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...
分类:
其他好文 时间:
2015-05-07 12:36:34
阅读次数:
119
【题目】
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin...
分类:
其他好文 时间:
2015-05-06 23:10:19
阅读次数:
391
Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
解题思路:
按照小学的做法,每位...
分类:
其他好文 时间:
2015-05-06 21:16:09
阅读次数:
118
https://leetcode.com/problems/largest-number/Given a list of non negative integers, arrange them such that they form the largest number.For example, g...
分类:
其他好文 时间:
2015-05-06 20:59:18
阅读次数:
117
此将主要将leetcode中sort专题的解答都放在这里,后续会慢慢加入
一:leetcode179 Largest Number
题目:
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 3...
分类:
其他好文 时间:
2015-05-06 19:46:06
阅读次数:
136
Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given ...
分类:
移动开发 时间:
2015-05-06 17:52:41
阅读次数:
142