Problem Description
Continuous Same Game is a simple game played on a grid of colored blocks. Groups of two or more connected (orthogonally, not diagonally) blocks that are the same color may be r...
分类:
其他好文 时间:
2014-08-03 23:21:29
阅读次数:
336
Description
There is a number of disjoint vertical line segments in the plane. We say that two segments are horizontally visible if they can be connected by a horizontal line segment that does not ...
分类:
其他好文 时间:
2014-08-03 23:16:26
阅读次数:
412
Give two versions of WA code:
Version 1: Runtime Error: Find the bug
class Solution {
public:
void find(const string& s, const unordered_set& dict, vector& res) {
int i, j, len = s.length();
...
分类:
其他好文 时间:
2014-08-03 15:21:27
阅读次数:
329
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
/**
...
分类:
其他好文 时间:
2014-08-03 12:54:55
阅读次数:
201
Description
You have N integers, A1, A2, ... ,
AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other ...
分类:
其他好文 时间:
2014-08-03 12:53:25
阅读次数:
311
Description
Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by mo...
分类:
其他好文 时间:
2014-08-02 23:27:14
阅读次数:
327
Big String
Time Limit: 2 Seconds Memory Limit: 65536 KB
We will construct an infinitely long string from two short strings: A = "^__^" (four characters), and B = "T.T" (three characters). R...
分类:
其他好文 时间:
2014-08-02 21:02:04
阅读次数:
291
题目再现
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time
complexity should be O(log (m+n)).
题意解析...
分类:
其他好文 时间:
2014-08-02 18:24:13
阅读次数:
335
问题:有序合并两个有序链表分析:归并排序的合并部分class Solution {public: ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) { ListNode *helper=new ListNode(0); ...
分类:
其他好文 时间:
2014-08-02 18:17:03
阅读次数:
170
Description
Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.
It orders two arms of negligible weight and each arm's lengt...
分类:
其他好文 时间:
2014-08-02 15:30:13
阅读次数:
235