【JavaScript】Leetcode每日一题-最大整除子集 【题目描述】 给你一个由 无重复 正整数组成的集合 nums ,请你找出并返回其中最大的整除子集 answer ,子集中每一元素对(answer[i], answer[j])都应当满足: answer[i] % answer[j] == ...
分类:
编程语言 时间:
2021-04-24 11:53:00
阅读次数:
0
学习自:CS-Note Leetcode 题解 - 双指针 1、有序数组的Two Sum 167. 两数之和 II - 输入有序数组 题目描述: 给定一个已按照 升序排列 的整数数组 numbers ,请你从数组中找出两个数满足相加之和等于目标数 target 。 函数应该以长度为 2 的整数数组的 ...
分类:
其他好文 时间:
2021-04-23 12:22:04
阅读次数:
0
## 198. House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only co ...
分类:
其他好文 时间:
2021-04-23 12:11:50
阅读次数:
0
题目描述 给你一个字符串 s 和一个整数 k ,请你找出 s 中的最长子串, 要求该子串中的每一字符出现次数都不少于 k 。返回这一子串的长度。 示例 输入:s = "aaabb", k = 3 输出:3 解释:最长子串为 "aaa" ,其中 'a' 重复了 3 次。 输入:s = "ababbc" ...
分类:
其他好文 时间:
2021-04-23 12:08:52
阅读次数:
0
/* * @lc app=leetcode.cn id=1143 lang=cpp * * [1143] 最长公共子序列 * * https://leetcode-cn.com/problems/longest-common-subsequence/description/ * * algorith ...
分类:
其他好文 时间:
2021-04-23 12:08:02
阅读次数:
0
1.状态定义 dp[i]表示组成面额 i,有多少种方案。 2.状态转移方程 int[] coins = new int[]{1,5,10,25}; for(int coin: coins) { dp[k] += dp[k - coin]; } 比如dp[36] = dp[36-1] + dp[36 ...
分类:
其他好文 时间:
2021-04-23 12:06:20
阅读次数:
0
i: /* * @lc app=leetcode.cn id=127 lang=cpp * * [127] 单词接龙 * * https://leetcode-cn.com/problems/word-ladder/description/ * * algorithms * Hard (45.95% ...
分类:
其他好文 时间:
2021-04-22 15:58:08
阅读次数:
0
二分查找的基本框架 int binarySearch(int[] nums, int target) { int left = 0, right = ...; while(...) { int mid = left + (right - left) / 2; if (nums[mid] == tar ...
分类:
其他好文 时间:
2021-04-22 15:54:34
阅读次数:
0
斐波那契数,通常用 F(n) 表示,形成的序列称为 斐波那契数列 。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是: F(0) = 0,F(1) = 1F(n) = F(n - 1) + F(n - 2),其中 n > 1给你 n ,请计算 F(n) 。 示例 : 输入:2 ...
分类:
其他好文 时间:
2021-04-22 15:28:32
阅读次数:
0
Description: There are a total of n courses you have to take labelled from 0 to n - 1. Some courses may have prerequisites, for example, if prerequisi ...
分类:
其他好文 时间:
2021-04-21 12:51:08
阅读次数:
0