自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

刘天的博客

主要以刷oj题为主

  • 博客(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关注的人

提示
确定要删除当前文章?
取消 删除