题目链接:https://leetcode cn.com/problems/ju zhen zhong de lu jing lcof/ dfs ...
分类:
其他好文 时间:
2020-05-04 15:50:48
阅读次数:
47
当时参加周赛的时候没做出来,后来通过看题解,学习到了状态压缩dp,对于这一题是理解了,但是状态压缩dp运用的还不是特别好。记录一下解题过程。 来源:力扣(LeetCode) 链接:https://leetcode cn.com/problems/number of ways to wear diff ...
分类:
其他好文 时间:
2020-05-04 15:10:39
阅读次数:
98
题目地址:https://leetcode-cn.com/problems/nge-tou-zi-de-dian-shu-lcof/ 题目描述 把n个骰子扔在地上,所有骰子朝上一面的点数之和为s。输入n,打印出s的所有可能的值出现的概率。你需要用一个浮点数数组返回答案,其中第 i 个元素代表这 n ...
分类:
编程语言 时间:
2020-05-04 13:42:57
阅读次数:
77
地址 https://leetcode-cn.com/problems/jump-game/ 给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 判断你是否能够到达最后一个位置。 示例 1: 输入: [2,3,1,1,4] 输出: true 解释: ...
分类:
其他好文 时间:
2020-05-04 13:36:25
阅读次数:
53
本文首先通过一个例子讲解了深度优先搜索的原理,然后给出了算法的通用框架,接着根据通用框架总结了算法的实现一般规则,使用者按照该规则即可写出深度优先搜索代码。最后通过三个题目,结合文章总结的规则指导你如何应用到实践中。 ...
分类:
编程语言 时间:
2020-05-04 00:38:32
阅读次数:
80
题目 https://leetcode cn.com/problems/longest continuous subarray with absolute diff less than or equal to limit/ 给你一个整数数组 nums ,和一个表示限制的整数 limit,请你返回最长 ...
分类:
编程语言 时间:
2020-05-03 20:45:38
阅读次数:
69
25. K 个一组翻转链表 题目来源: "https://leetcode cn.com/problems/reverse nodes in k group" 题目 给你一个链表,每 k 个节点一组进行翻转,请你返回翻转后的链表。 k 是一个正整数,它的值小于或等于链表的长度。 如果节点总数不是 k ...
分类:
编程语言 时间:
2020-05-03 20:32:17
阅读次数:
56
题目 https://leetcode cn.com/problems/find the kth smallest sum of a matrix with sorted rows/ 给你一个 m n 的矩阵 mat,以及一个整数 k ,矩阵中的每一行都以非递减的顺序排列。 你可以从每一行中选出 1 ...
分类:
编程语言 时间:
2020-05-03 20:16:18
阅读次数:
80
题目 https://leetcode cn.com/problems/constrained subsequence sum/ 给你一个整数数组?nums?和一个整数?k?,请你返回 非空?子序列元素和的最大值,子序列需要满足:子序列中每两个 相邻?的整数?nums[i]?和?nums[j]?,它 ...
分类:
编程语言 时间:
2020-05-03 18:56:53
阅读次数:
88
[TOC] ? 748. 最短完整词 https://leetcode cn.com/problems/shortest completing word/ 描述 解答 我估计,是可以先把牌照里面的统计好,然后到目标单词里,一个个比对; c watch todo 2020 05 03 15:08 cp ...
分类:
其他好文 时间:
2020-05-03 17:03:48
阅读次数:
68