
LeetCode解题记录
looushu
還未可知
展开
-
LeetCode 第三题,Longest Substring Without Repeating Characters
题目: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.原创 2014-08-03 20:38:44 · 10385 阅读 · 4 评论 -
LeetCode之Roman & Integer 的转换(简单题)
罗马数字和现在使用的阿拉伯整数之间的转换在LeetCode上一共有两道题目:Roman to Integer 和Integer to Roman 如标题所说的,这是个简单的字符串处理的题目,基本上知道了规则就可以直接写出代码解决了。罗马数字基本规则做好这道题目的前提是知道一些罗马数字的基本规则。原创 2015-07-17 15:37:58 · 1219 阅读 · 0 评论 -
LeetCode 第九题, Palindrome Number
题目原文:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of conv原创 2014-09-08 20:27:40 · 1879 阅读 · 0 评论 -
LeetCode第八题, 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 in原创 2014-09-07 10:58:30 · 1742 阅读 · 0 评论 -
LeetCode第七题,Reverse Integer
题目Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask原创 2014-08-08 23:06:37 · 1578 阅读 · 0 评论 -
LeetCode第六题,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原创 2014-08-06 12:15:24 · 2192 阅读 · 0 评论 -
LeetCode 第二题,Median of Two Sorted Arrays
题目再现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)).题意解析原创 2014-08-02 17:18:04 · 2790 阅读 · 0 评论 -
LeetCode第四题,Add Two Numbers
题目原文: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原创 2014-08-04 21:31:32 · 1547 阅读 · 0 评论 -
LeetCode第五题,Longest Palindromic Substring
题目原文:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length ofS is 1000, and there exists one unique longest palindromic substring.题意解析:最长回文子串。就是原创 2014-08-05 14:29:41 · 4843 阅读 · 1 评论 -
LeetCode 第一题,Two Sum
题目还原Two SumGiven 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 t原创 2014-08-01 01:43:51 · 4506 阅读 · 0 评论 -
LeetCode之LCP(Longest Common Prefix)问题
这个也是简单题目,但是关键在于题意的理解。 题目原文就一句话:Write a function to find the longest common prefix string amongst an array of strings. 题意是给一个字符串数组,找出这个字符串数组中所有字符串的最长公共前缀。 注意是限定的前缀,而不是子串。原创 2015-07-17 18:47:01 · 3807 阅读 · 0 评论