
程序代码
文章平均质量分 69
傲龙残雪
We need to do more and better, to reach the top of a field.
展开
-
Leetcode 8 String to Integer
题目描述:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possib原创 2016-09-09 14:36:28 · 224 阅读 · 0 评论 -
Leetcode 28 Implement strStr()
题目要求:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.-----------------------------------------------------------原创 2016-10-20 20:38:57 · 267 阅读 · 0 评论 -
Leetcode 66 Plus One
题目要求:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at the head of the list.---------------原创 2016-11-10 15:52:00 · 470 阅读 · 0 评论 -
Leetcode 58 Length of Last Word
题目要求:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note原创 2016-11-09 17:07:57 · 288 阅读 · 0 评论 -
Leetcode 38 Count and Say
题目要求: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 off as "two 1s" or 21.21 is r原创 2016-11-08 11:12:45 · 201 阅读 · 0 评论 -
Leetcode 36 Valid Sudoku
题目要求:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A part原创 2016-10-25 17:31:28 · 211 阅读 · 0 评论 -
Leetcode 26 Remove Duplicates from Sorted Array
题目要求:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in原创 2016-09-21 16:24:36 · 222 阅读 · 0 评论 -
Leetcode 24 Swap Nodes in Paris
题目大意:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only consta原创 2016-09-20 16:23:34 · 317 阅读 · 0 评论 -
Leetcode 7 Reverse Integer
题目描述:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321最需注意的就是倒置后的整形溢出问题,当>2147483647和<-2147483647时,返回0class Solution {public: int reverse(i原创 2016-09-07 15:00:26 · 240 阅读 · 0 评论 -
Leetcode 21 Merge Two Sorted Lists
题目要求:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.----------------------------------------------原创 2016-09-19 09:59:58 · 217 阅读 · 0 评论 -
Leetcode 20 Valid Parenthesis
题目要求:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" a原创 2016-09-18 20:49:15 · 698 阅读 · 0 评论 -
Leetcode 6 ZigZag Conversion
题目描述:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N原创 2016-09-05 22:54:21 · 253 阅读 · 0 评论 -
Leetcode 19 Remove Nth Node from End of List
题目要求:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from t原创 2016-09-18 16:15:01 · 283 阅读 · 0 评论 -
Leetcode 14 Longest Common Prefix
题目要求:Write a function to find the longest common prefix string amongst an array of strings.-------------------------------------------------------------------------------------------------------原创 2016-09-14 10:19:42 · 219 阅读 · 0 评论 -
Leetcode 2 Add 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 and return i原创 2016-09-01 10:29:28 · 213 阅读 · 0 评论 -
Leetcode 13 Roman to Integer
题目要求:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.罗马数字的规律核心在于:小的数字在大的数字的右边,所表示的数等于这些数字相加得到的数,反之相减。罗马数字的特殊字符:原创 2016-09-12 16:45:17 · 216 阅读 · 0 评论 -
Leetcode 9 Palindrome Number
题目要求:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer原创 2016-09-12 16:42:44 · 291 阅读 · 0 评论 -
Leetcode 27 Remove Element
题目要求:Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant原创 2016-10-08 18:42:45 · 291 阅读 · 0 评论