4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
Note:
Elemen...
分类:
其他好文 时间:
2015-07-06 18:02:56
阅读次数:
98
How Many Equations Can You FindTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionNow give you an string which only contai...
分类:
其他好文 时间:
2015-07-06 17:34:29
阅读次数:
122
题目:
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 leaf node.
解题:
求根节点到最近的叶子节点之间的距离
用...
分类:
编程语言 时间:
2015-07-06 16:08:36
阅读次数:
152
题目:
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 leaf node.
解题:
求最大深度 和前面一题类似 用递归遍历就...
分类:
编程语言 时间:
2015-07-06 16:06:14
阅读次数:
143
问题描述Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm’s runtime complexity must be in the order of O(log n).
If the target is not found i...
分类:
其他好文 时间:
2015-07-06 14:23:26
阅读次数:
110
3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input wou...
分类:
其他好文 时间:
2015-07-06 14:22:40
阅读次数:
119
How Many Equations Can You Find
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 644 Accepted Submission(s): 424
Problem Description...
分类:
其他好文 时间:
2015-07-06 14:14:56
阅读次数:
95
题目:
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.
题意:
给定字符串S...
分类:
编程语言 时间:
2015-07-06 12:30:14
阅读次数:
115
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 leaf node.Hide Tags: Tree ,Depth-first Search/**
* D...
分类:
其他好文 时间:
2015-07-06 12:29:01
阅读次数:
112
3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,...
分类:
其他好文 时间:
2015-07-06 12:21:02
阅读次数:
167