摘要: 问题描述:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题思路:上一题反过来就可以了,其实觉得这两道题很没有意思。代码如下:publ... 阅读全文
posted @ 2015-04-25 23:37 scottwang 阅读(238) 评论(1) 推荐(0) 编辑
摘要: 题目描述:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.解题思路:这道题没什么技术含量,一个一个除10以及取模运算就行。代码如下:pu... 阅读全文
posted @ 2015-04-25 23:12 scottwang 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ... 阅读全文
posted @ 2015-04-25 22:51 scottwang 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding ele... 阅读全文
posted @ 2015-04-25 22:00 scottwang 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are t... 阅读全文
posted @ 2015-04-25 13:56 scottwang 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 问题描述: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 be... 阅读全文
posted @ 2015-04-25 13:52 scottwang 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are some good question... 阅读全文
posted @ 2015-04-25 13:43 scottwang 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 问题描述: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 ... 阅读全文
posted @ 2015-04-25 13:40 scottwang 阅读(593) 评论(0) 推荐(0) 编辑
摘要: 问题描述: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 l... 阅读全文
posted @ 2015-04-25 13:32 scottwang 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 问题描述: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 complexi... 阅读全文
posted @ 2015-04-25 13:26 scottwang 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 问题描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette... 阅读全文
posted @ 2015-04-25 13:20 scottwang 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 问题描述: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 si... 阅读全文
posted @ 2015-04-25 13:11 scottwang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 小二终于开通博客了,真是高兴。最近在看Java,所以就拿leetcode练练手了。以后我会将自己解体过程中的思路写下来,分享给大家,其中有我自己原创的部分,也有参考别人的代码加入自己理解的部分,希望大家看了多提意见,一块加油。问题描述:Given an array of integers, find... 阅读全文
posted @ 2015-04-25 12:55 scottwang 阅读(476) 评论(0) 推荐(0) 编辑