摘要: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have t 阅读全文
posted @ 2017-02-10 12:47 璨璨要好好学习 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2017-02-10 11:22 璨璨要好好学习 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
posted @ 2017-02-10 03:52 璨璨要好好学习 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文
posted @ 2017-02-10 02:41 璨璨要好好学习 阅读(181) 评论(0) 推荐(0) 编辑
摘要: A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) 阅读全文
posted @ 2017-02-08 09:07 璨璨要好好学习 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to 阅读全文
posted @ 2017-02-07 09:14 璨璨要好好学习 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2017-02-07 05:19 璨璨要好好学习 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2017-02-04 10:08 璨璨要好好学习 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target. A valid path is from root node to any of the le 阅读全文
posted @ 2017-02-03 09:52 璨璨要好好学习 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Notice LintCode will print the subtree which root is your 阅读全文
posted @ 2017-02-03 08:59 璨璨要好好学习 阅读(1249) 评论(0) 推荐(0) 编辑