LeetCode
文章平均质量分 65
dolpphins
这个作者很懒,什么都没留下…
展开
-
LeetCode Problem:Reverse Integer
Problem 7:Reverse IntegerReverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 补充C++中int类型变量的表示范围为:-2147483648~2147483647。为什么是这个范围呢?我们知道int有32位,最高那位是符号位。注意下面说的都是原创 2015-09-13 22:48:27 · 354 阅读 · 0 评论 -
LeetCode Problem:Add Two Numbers
Problem 2:Two Numbers 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原创 2015-09-03 20:37:17 · 388 阅读 · 0 评论 -
LeetCode Problem:Two Sum
Problem 1:Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up t原创 2015-09-03 19:30:30 · 387 阅读 · 0 评论 -
LeetCode Problem:Odd Even Linked List
题目: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should tr原创 2016-02-03 19:10:50 · 286 阅读 · 0 评论 -
LeetCode Problem:String to Integer (atoi)
AC代码class Solution { public: int myAtoi(string str) { str = trim(str); // int n = str.size(); if(n <= 0) { return 0; } long long result =原创 2016-02-04 20:14:47 · 372 阅读 · 0 评论