package LeetCode_224 import java.util.* /** * 224. Basic Calculator * https://leetcode.com/problems/basic-calculator/description/ * * Implement a basi ...
分类:
其他好文 时间:
2020-06-13 19:22:56
阅读次数:
53
2. 两数相加 ####给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 #####如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 #####您可以假设除了数字 0 之外,这两个数都不会以 0 ...
分类:
其他好文 时间:
2020-06-13 17:35:23
阅读次数:
58
Description Given a positive integer n, find the number of non-negative integers less than or equal to n, whose binary representations do NOT contain ...
分类:
其他好文 时间:
2020-06-13 17:32:34
阅读次数:
56
1.题目链接 https://leetcode-cn.com/problems/coin-change/ 2.题目描述 给定不同面额的硬币 coins 和一个总金额 amount。编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,返回 -1。 示例 1: 输 ...
分类:
其他好文 时间:
2020-06-13 17:24:42
阅读次数:
80
链接:https://leetcode-cn.com/problems/3sum-closest/ 代码 class Solution { public int threeSumClosest(int[] nums, int target) { int ans = nums[0] + nums[1] ...
分类:
其他好文 时间:
2020-06-13 17:24:10
阅读次数:
58
判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。 ...
分类:
其他好文 时间:
2020-06-13 17:14:37
阅读次数:
71
descption We have a sorted set of digits D, a non-empty subset of {'1','2','3','4','5','6','7','8','9'}. (Note that '0' is not included.) Now, we writ ...
分类:
其他好文 时间:
2020-06-13 17:10:49
阅读次数:
64
package LeetCode_40 /** * 40. Combination Sum II * https://leetcode.com/problems/combination-sum-ii/description/ * * Given a collection of candidate n ...
分类:
其他好文 时间:
2020-06-13 15:59:33
阅读次数:
59
地址 https://leetcode-cn.com/problems/climbing-stairs/ 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢? 注意:给定 n 是一个正整数。 示例 1: 输入: 2 输出: 2 解释: ...
分类:
其他好文 时间:
2020-06-13 12:49:59
阅读次数:
65
206. 反转链表 反转一个单链表。 示例: 输入: 1->2->3->4->5->NULL 输出: 5->4->3->2->1->NULL 进阶: 你可以迭代或递归地反转链表。你能否用两种方法解决这道题? class Node(): def __init__(self, data): self.v ...
分类:
其他好文 时间:
2020-06-13 12:46:44
阅读次数:
59