- 博客(9)
- 收藏
- 关注
原创 Palindrome Number问题及解法
问题描述:Determine whether an integer is a palindrome. Do this without extra space.求解一个数是不是回文数。问题求解思路:1.负数不是回文数2.回文数正着读和反着读一样,故可将该数反转与原数比较大小我的代码如下:class Solution {public: bool i
2017-02-28 14:38:35 225
原创 String to Integer (atoi)问题及解法
问题描述: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 possible i
2017-02-27 16:49:18 274
原创 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 NA
2017-02-27 10:27:36 273
原创 Reverse Integer问题及解法
问题描述:Reverse digits of an integer.示例:Example1: x = 123, return 321Example2: x = -123, return -321话不多说,代码很清楚class Solution {public: int reverse(int x) { long long rev = 0;
2017-02-24 09:09:03 364
原创 Longest Palindromic Substring问题及解法
问题描述:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.示例:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.
2017-02-23 09:43:39 342
转载 Median of Two Sorted Arrays问题及解法
问题描述:There are two sorted arrays nums1 and nums2 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)).示例:nums1 = [1
2017-02-22 11:03:31 509
原创 Longest Substring Without Repeating Characters题目及解法
问题描述:Given a string, find the length of the longest substring without repeating characters.示例:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b",
2017-02-21 13:05:08 359
原创 Add Two Numbers问题及解法
问题描述:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers a
2017-02-16 09:17:32 1124
原创 Two Sum问题及解法
问题描述:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use
2017-02-13 17:28:39 859
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人