【Leetcode】9. Palindrome Number 判断一个数字是否是回文数字

2016-10-25
阅读 1 分钟
2.6k
Determine whether an integer is a palindrome. Do this without extra space.

【Leetcode】8. String to Integer (atoi) 字符串转整型

2016-10-25
阅读 3 分钟
2k
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.

【Leetcode】7. Reverse Integer 整数字面反转

2016-10-25
阅读 1 分钟
2.3k
如果是负数,先转换为正数在处理,处理之后再补上符号位。通过模10、余10可以从低到高的按序获得每一位数字,按照乘10累加即可。注意1:有些数字反转之后会越界,需要特别处理。注意2:负数反转时要特别注意-2^31直接反转时越界的,要特殊处理。

【Leetcode】6. ZigZag Conversion

2016-10-25
阅读 2 分钟
1.3k
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)

【leetcode】5. Longest Palindromic Substring 最长回文子串

2016-10-25
阅读 2 分钟
2.2k
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.

【leetcode】4. Median of Two Sorted Arrays 两个有序数组组成集合的中位数

2016-10-25
阅读 2 分钟
2.2k
There are two sorted arrays nums1 and nums2 of size m and n respectively.

【Leetcode】3. Longest Substring Without RepeatingCharacters无重最长子串

2016-10-25
阅读 2 分钟
1.8k
Given a string, find the length of the longest substring without repeating characters.

【Leetcode】2. Add Two Numbers 两个链表的对应元素加和的新链表

2016-10-25
阅读 3 分钟
1.6k
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 it as a linked list.

【Leetcode】1. Two Sum 集合中找到两个元素之和等于给定值

2016-10-25
阅读 1 分钟
1.9k
Given an array of integers, return indices of the two numbers such that they add up to a specific target.