注:LeetCode--树专题。 题目链接(1305):https://leetcode-cn.com/problems/all-elements-in-two-binary-search-trees/ 题目描述: 给你 root1 和 root2 这两棵二叉搜索树。 请你返回一个列表,其中包含 两 ...
分类:
其他好文 时间:
2020-03-27 21:47:16
阅读次数:
80
LeetCode 0070. Climbing Stairs爬楼梯【Easy】【Python】【动态规划】 Problem "LeetCode" You are climbing a stair case. It takes n steps to reach to the top. Each tim ...
分类:
编程语言 时间:
2020-03-27 21:32:23
阅读次数:
84
di地址:https://leetcode-cn.com/problems/subtract-the-product-and-sum-of-digits-of-an-integer/ <?php /** 给你一个整数 n,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。 示例 1: ...
分类:
其他好文 时间:
2020-03-27 12:57:16
阅读次数:
174
package LeetCode_7 /** * 7. Reverse Integer * https://leetcode.com/problems/reverse-integer/description/ * */ class Solution { fun reverse(x_: Int): I ...
分类:
其他好文 时间:
2020-03-27 12:36:34
阅读次数:
48
地址:https://leetcode-cn.com/problems/guess-numbers/ <?php /** 小A 和 小B 在玩猜数字。小B 每次从 1, 2, 3 中随机选择一个,小A 每次也从 1, 2, 3 中选择一个猜。他们一共进行三次这个游戏,请返回 小A 猜对了几次? 输入 ...
分类:
其他好文 时间:
2020-03-27 12:29:34
阅读次数:
122
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12576257.html 车的可用捕获量(105min) 题目链接:https://leetcode-cn.com/problems/available-captures-for-rook/ 在一个 8 x ...
分类:
其他好文 时间:
2020-03-26 19:31:13
阅读次数:
66
一.问题 https://leetcode-cn.com/problems/nge-tou-zi-de-dian-shu-lcof/:面试题60:n个骰子的点数 二.解法 动态规划:用 dp[n][j] 来表示n个骰子的点数 j 出现的次数。 状态转移方程:表示n个骰子产生的点数 j 出现的次数等于 ...
分类:
其他好文 时间:
2020-03-26 01:26:22
阅读次数:
69
英文题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805360043343872 中文题目:https://pintia.cn/problem-sets/994805260223102976/problems/994 ...
分类:
其他好文 时间:
2020-03-25 16:13:14
阅读次数:
60
/** * 860. Lemonade Change * https://leetcode.com/problems/lemonade-change/description/ * */ class Solution { //使用贪心,策略是每次找钱选择大面额,尽量保留5元的 fun lemonade ...
分类:
其他好文 时间:
2020-03-25 01:52:04
阅读次数:
82
"原题链接" 题外话 今天一如既往地不会呢 题意 一共n个数 选【1,i】将每个数都加一个数 选【1,i】将每个数都取余一个数 问你是否能够造出长度为n的严格上升序列 思路 今天才知道,其实每次把当前的数进行取余,然后加上当前数的前一位就能严格单调,, 代码 ...
分类:
其他好文 时间:
2020-03-25 01:42:38
阅读次数:
61