Install Dependencies 给定软件之间安装的依赖关系,用一个二维数组表示,第一维表示依赖的序号,第二维表示依赖关系,比如要先装deps[0][0],才能装deps[0][1]。安装时,要尽可能先安装依赖个…
标签:LeetCode题目解答
[Leetcode] Maximum and Minimum Depth of Binary Tree 二叉树的最小最大深度
Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of n…
[Leetcode] Clone Graph 复制图
Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ…
[LeetCode] Binary Tree Level Order Traversal 二叉树层序遍历
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from l…
[LeetCode] Zuma Game 祖玛游戏
Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(…
[LeetCode] Student Attendance Record I 学生出勤记录之一
You are given a string representing an attendance record for a student. The record only contains the fo…
[LeetCode] Range Module 范围模块
A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the foll…
LeetCode之Bit Manipulation题目汇总
Bitwise AND of Numbers Range Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise…
[Leetcode] First Bad Version 第一个错误版本
First Bad Version You are a product manager and currently leading a team to develop a new product. Unfortunate…
[Leetcode] Number of 1 Bits 一的位数
Number of 1 Bits Write a function that takes an unsigned integer and returns the number of ’1′ bits it h…
[LeetCode] Count Numbers with Unique Digits 计算各位不相同的数字个数
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example:…
[LeetCode] Poor Pigs 可怜的猪
There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They …