- 博客(11)
- 收藏
- 关注
原创 400. Nth Digit
问题来源:https://leetcode.com/problems/add-strings/ 问题描述:Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...Note:n is positive and will fit within the ra
2016-11-11 13:40:37 275
原创 415. Add Strings
问题来源:https://leetcode.com/problems/add-strings/ 问题描述:Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.
2016-11-10 13:34:39 295
原创 13. Roman to Integer
问题来源:https://leetcode.com/problems/roman-to-integer/ 问题描述:Given a roman numeral, convert it to an integer. 我的代码:主要找出罗马数字规律即可。int romanToInt(string s){ map roman; roman.insert(pair('I'
2016-11-09 11:04:12 334
原创 9. Palindrome Number
问题来源:https://leetcode.com/problems/palindrome-number/ 问题描述:Determine whether an integer is a palindrome. Do this without extra space. 我的代码:问题较简单,解决方案较多,直接上代码:bool isPalindrome(int x){
2016-11-08 12:46:29 317
原创 453. Minimum Moves to Equal Array Elements
问题来源:https://leetcode.com/problems/minimum-moves-to-equal-array-elements/ 问题描述:Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements e
2016-11-07 14:55:03 944
原创 C++中stringstream的使用方法和样例
之前在leetcode中进行string和int的转化时使用过istringstream,现在大致总结一下用法和测试用例。 介绍:C++引入了ostringstream、istringstream、stringstream这三个类,要使用他们创建对象就必须包含sstream.h头文件。istringstream类用于执行C++风格的串流的输入操作。ostringstream类用于
2016-11-06 15:46:49 55942
原创 8. String to Integer (atoi)
问题来源:https://leetcode.com/problems/string-to-integer-atoi/ 问题描述:Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases.
2016-11-03 16:20:03 448
原创 441. Arranging Coins
问题来源:https://leetcode.com/problems/arranging-coins/ 问题描述:You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find
2016-11-02 17:37:34 259
原创 172. Factorial Trailing Zeroes
问题来源:https://leetcode.com/problems/factorial-trailing-zeroes/ 问题描述:Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.
2016-11-02 16:55:27 404 1
原创 223. Rectangle Area
问题来源:https://leetcode.com/problems/rectangle-area/ 问题描述:Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner.
2016-11-02 12:51:20 287
原创 414. Third Maximum Number
问题来源:https://leetcode.com/problems/third-maximum-number/ 问题描述:Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number
2016-11-01 21:03:07 367 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人