Given a positive integer n, find the number of non-negative integers less than or equal to n,…
分类:LeetCode题目解答
[Leetcode] Permutation Sequence 全排列序列
Permutation Sequence The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling a…
[LeetCode] Relative Ranks 相对排名
Given scores of N athletes, find their relative ranks and the people with the top three highe…
力扣(LeetCode)263
题目地址:https://leetcode-cn.com/probl…题目描述:编写一个程序判断给定的数是否为丑数。 丑数就是只包含质因数 2, 3, 5 的正整数。 示例 1: 输入: 6输出: true解…
[Leetcode] Binary Tree Paths 二叉树路径
Root To Leaf Binary Tree Paths Given a binary tree, return all root-to-leaf paths. 递归法 复杂度 时间 O(b^(h+1)-1) 空间 …
[LeetCode] Dungeon Game 地牢游戏
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The du…
60. Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permut…
2. Add Two Numbers
2. Add Two Numbers 题目 You are given two non-empty linked lists representing two non-negative integers. The dig…
[LeetCode] Sort Colors 颜色排序
Given an array with n objects colored red, white or blue, sort them so that objects of the sa…
[LeetCode] Department Top Three Salaries 系里前三高薪水
The Employee table holds all employees. Every employee has an Id, and there is also a column …
[LeetCode] Coin Change 硬币找零
You are given coins of different denominations and a total amount of money amount. Write a functio…
Maximum Submatrix & Largest Rectangle
相关题型 问题一(最大和子矩阵) : 有一个 m x n 的矩阵,矩阵的元素可正可负。请找出该矩阵的一个子矩阵(方块),使得其所有元素之和在所有子矩阵中最大。(问题来源:http://acm.pku.edu.cn/Jud…