[LeetCode] 翻转数字

2014-03-31
阅读 1 分钟
3.9k
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321

[LeetCode] 寻找最长回文字串

2014-03-31
阅读 2 分钟
2.4k
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] Median of Two Sorted Arrays

2014-03-31
阅读 2 分钟
3.5k
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

[LeetCode]Longest Substring Without Repeating Characters

2014-03-30
阅读 2 分钟
2.6k
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1.

[LeetCode]Two Sum

2014-03-30
阅读 4 分钟
3.6k
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 to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) ...

[LeetCode]Add Two Numbers

2014-03-30
阅读 2 分钟
2.7k
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. Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8