摘要: Search for a Range问题leetcodejava二分查找 1. 问题描述Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity mu... 阅读全文
posted @ 2017-09-08 00:33 流泉滴沙 阅读(236) 评论(0) 推荐(0)
摘要: atoi问题leetcodejavaatoi 1.问题描述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 wha... 阅读全文
posted @ 2017-09-04 13:29 流泉滴沙 阅读(391) 评论(0) 推荐(0)
摘要: Palindrome Number问题leetcodejava回文数 1.问题描述Determine whether an integer(整数) is a palindrome(回文). Do this without extra space.题目翻译:确定一个整数是不是回文数,不能使用额外的空间。 2.解题思路1.把整数直接转成字符串,然后把字符串reverse一下,比较两个字符是否相等... 阅读全文
posted @ 2017-09-04 11:19 流泉滴沙 阅读(204) 评论(0) 推荐(0)
摘要: Longest Palindromic Substring问题leetcodejavaDP 1.题目描述Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "... 阅读全文
posted @ 2017-08-28 20:03 流泉滴沙 阅读(271) 评论(0) 推荐(0)
摘要: twosum问题leetcodetwusumjava 1. 题目描述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 solut... 阅读全文
posted @ 2017-08-25 13:37 流泉滴沙 阅读(237) 评论(0) 推荐(0)
摘要: longest substring问题最长子串滑动窗口HashMap 1.题目描述Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.G... 阅读全文
posted @ 2017-08-25 10:33 流泉滴沙 阅读(444) 评论(0) 推荐(0)