Problem Description:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without u...
分类:
其他好文 时间:
2014-07-07 17:00:35
阅读次数:
161
Problem Description:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution: 1 public bo....
分类:
其他好文 时间:
2014-07-07 16:08:01
阅读次数:
151
Problem Description:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your pr...
分类:
其他好文 时间:
2014-07-07 15:46:01
阅读次数:
267
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?矩阵的旋转如1 2 34 5 67 8...
分类:
其他好文 时间:
2014-07-07 15:13:49
阅读次数:
181
题目:Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it withou...
分类:
其他好文 时间:
2014-07-07 13:44:29
阅读次数:
281
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?
分类:
其他好文 时间:
2014-07-07 13:07:00
阅读次数:
153
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
分类:
其他好文 时间:
2014-07-03 11:51:05
阅读次数:
117
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 nu...
分类:
其他好文 时间:
2014-06-30 21:36:50
阅读次数:
292
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
原地图像顺时针旋转90度。因为要求空间复杂度是常数,因此应该迭代旋转操作。
class ...
分类:
其他好文 时间:
2014-06-30 19:51:53
阅读次数:
267
题目大意:
刚才上88个键弹出来的音符。
如果出现重复的,或者是高一个音阶的重复的都算。
思路分析:
具体可以参考训练指南222.
height数组表示按照排序后的sa最近的两个后缀的最长前缀。
将height 分块。然后二分答案,二分答案之后去判断是否满足。
要考虑到不重合,还有大于5。
所以二分的时候要从5开始,然后判断的时候要加一个 up - down >le...
分类:
其他好文 时间:
2014-06-30 19:27:18
阅读次数:
242