小菜鸟的LeetCode之路
文章平均质量分 69
jack_nate
这个作者很懒,什么都没留下…
展开
-
LeetCode(java)6. 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 P L S I原创 2016-04-10 19:43:42 · 205 阅读 · 0 评论 -
LeetCode(java)7. Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321题目描述:按位反转数字2种解题思路:①变为StringBuffer,调用reverse函数再调用Integer的valueOf函数,通过捕捉异常判断是否溢出:leetcode通过时间为:原创 2016-04-10 20:38:44 · 334 阅读 · 0 评论 -
LeetCode(java)5. 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, and there exists one unique longest palindromic substring.题目描述:找出一个字符串中的最长原创 2016-04-10 19:23:35 · 267 阅读 · 0 评论 -
LeetCode(java)4. 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)).题目描述:给出两个长度分别为m和n的递增数组num原创 2016-04-10 18:30:02 · 285 阅读 · 0 评论 -
LeetCode(java)3. 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. For原创 2016-04-06 15:17:38 · 182 阅读 · 0 评论 -
LeetCode(java)2. 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 as a link原创 2016-04-06 14:50:01 · 189 阅读 · 0 评论 -
LeetCode(java)1. 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.Example:Given nums =原创 2016-04-06 12:45:43 · 204 阅读 · 0 评论 -
LeetCode(java)8. 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 input ca原创 2016-04-12 16:45:35 · 267 阅读 · 0 评论 -
LeetCode(java)9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.题目描述:判断一个数字是否为回文数组,不允许使用辅存。解法一:将数字x翻转后存于一个long中(防止溢出)leetcode通过时间为:9ms(不推荐,比较用long来解决溢出并不是题目希望的,目前未想到其他解决溢出的方法)public原创 2016-04-12 16:50:58 · 233 阅读 · 0 评论