随笔分类 -  [LeetCode 题解]

LeetCode 个人的题解,加一些愚见~欢迎探讨
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo 阅读全文
posted @ 2014-05-30 17:21 Double_win 阅读(143) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to ... 阅读全文
posted @ 2014-05-29 20:40 Double_win 阅读(296) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same color a... 阅读全文
posted @ 2014-05-29 18:02 Double_win 阅读(264) 评论(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 thi 阅读全文
posted @ 2014-05-26 10:50 Double_win 阅读(196) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given an array of integers, find two numbers such that they add up to a specific target number. The fu... 阅读全文
posted @ 2014-05-25 23:19 Double_win 阅读(134) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest sum... 阅读全文
posted @ 2014-05-22 22:56 Double_win 阅读(208) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You h... 阅读全文
posted @ 2014-05-22 22:38 Double_win 阅读(272) 评论(0) 推荐(0) 编辑
摘要:题目描述: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the tot 阅读全文
posted @ 2014-05-22 16:53 Double_win 阅读(231) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2014-05-19 17:27 Double_win 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2014-05-19 17:19 Double_win 阅读(274) 评论(0) 推荐(0) 编辑
摘要:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文
posted @ 2014-05-09 23:38 Double_win 阅读(154) 评论(0) 推荐(0) 编辑
摘要:Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 转载请注明出处: http://www.cnblogs.com/double-win/ 谢谢! 阅读全文
posted @ 2014-05-05 15:39 Double_win 阅读(165) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numb... 阅读全文
posted @ 2014-05-05 15:01 Double_win 阅读(347) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Implement pow(x, n). 2. 思路 题目很精简,不过需要考虑的情况很多,特别的需要注意 n可能为0 或者负数的情况。 另外,通过二分法,可以减少计算量。 3. 解法 clas... 阅读全文
posted @ 2014-05-04 16:59 Double_win 阅读(178) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 Given a non-negative number represented as an array of digits, plus one to the number. The digits ar... 阅读全文
posted @ 2014-05-04 11:39 Double_win 阅读(242) 评论(0) 推荐(0) 编辑
摘要:前言 【LeetCode 题解】系列传送门: http://www.cnblogs.com/double-win/category/573499.html 1.题目描述 The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you ma... 阅读全文
posted @ 2014-04-25 00:19 Double_win 阅读(380) 评论(0) 推荐(0) 编辑