- 博客(8)
- 收藏
- 关注
转载 Container With Most Water
Problem: https://leetcode.com/problems/container-with-most-water/ Solution: Of course we gonna think about brute force, the idea is pretty straight forward. For each pair, we calculate there
2015-04-04 07:59:26
186
转载 Longest Palindromic SubString -- LeetCode
原题链接: http://oj.leetcode.com/problems/longest-palindromic-substring/ 这道题是比较常考的题目,求回文子串,一般有两种方法。 第一种方法比较直接,实现起来比较容易理解。基本思路是对于每个子串的中心(可以是一个字符,或者是两个字符的间隙,比如串abc,中心可以是a,b,c,或者是ab的间隙,bc的间隙)往两边同时进行扫描,直到不是
2015-04-03 00:47:03
176
转载 Median of Two Sorted Arrays -- LeetCode
Problem: http://oj.leetcode.com/problems/median-of-two-sorted-arrays/ Solution: A easy idea to come up with is that using the what we use in Merge Sorted Array. Combine to sorted Array
2015-04-02 22:10:53
204
转载 Longest Substring Without Repeating Characters -- Leetcode Java
Problem: https://leetcode.com/problems/longest-substring-without-repeating-characters/ A linear algorithm. public int lengthOfLongestSubstring(String s) { if(s==null || s.length()==0)
2015-04-02 09:43:09
187
转载 Leetcode Java Add Two Numbers
Problem: 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 retur
2015-04-02 07:32:58
215
转载 LeetCode java Two Sum
The Problem: Given 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
2015-04-02 06:21:29
234
原创 Binary Tree Maximum Path Sum
原题地址:https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/ This is more complicate that previous question. There will be four different possible scenarios for maximum path. 1
2015-01-24 03:25:36
272
原创 LeetCode Path Sum II in Java
原题地址:http://oj.leetcode.com/problems/path-sum-ii/ 因为题目要求要将所有符合要求的路径用一个二维数组的方式来返回,所以我们使用数据结构维护中间路径结果。 注意recursive 调用之后,要保护现场(add then remove) /** * Definition for binary tree * public class Tree
2015-01-24 02:12:14
182
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人