上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页
Implement pow(x, n).刚开始没想到,后来看remlost的博客才写出来,代码很简练:class Solution {public: double pow(double x, int n) { if(n<0) return 1/power(x... Read More
posted @ 2014-08-21 09:54 Xylophone Views(222) Comments(0) Diggs(0)
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all d... Read More
posted @ 2014-08-21 09:31 Xylophone Views(133) Comments(0) Diggs(0)
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11. 11 is read of... Read More
posted @ 2014-08-21 00:14 Xylophone Views(111) Comments(0) Diggs(0)
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.... Read More
posted @ 2014-08-20 15:56 Xylophone Views(132) Comments(0) Diggs(0)
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... Read More
posted @ 2014-08-20 10:35 Xylophone Views(108) Comments(0) Diggs(0)
Given a collection of intervals, merge all overlapping intervals.For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].在LeetCode“... Read More
posted @ 2014-08-19 10:14 Xylophone Views(169) Comments(0) Diggs(0)
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial... Read More
posted @ 2014-08-19 10:02 Xylophone Views(144) Comments(0) Diggs(0)
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order, We get the following sequence... Read More
posted @ 2014-08-18 22:41 Xylophone Views(150) Comments(0) Diggs(0)
Given a list, rotate the list to the right by k places, where k is non-negative.For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3... Read More
posted @ 2014-08-18 21:28 Xylophone Views(153) Comments(0) Diggs(0)
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You shoul... Read More
posted @ 2014-08-18 20:42 Xylophone Views(183) Comments(0) Diggs(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页