Home avatar

翼仔的博客

334.递增的三元子序列

1 问题描述334. 递增的三元子序列 (Medium) 给你一个整数数组 nums ,判断这个数组中是否存在长度为 3 的递增子序列。 如果存在这样的三元组下标 (i, j, k) 且满足 i <

1218.最长定差子序列

1 问题描述1218. 最长定差子序列 (Medium) 给你一个整数数组 arr 和一个整数 difference,请你找出并返回 arr 中最长等差子序列的长度,该子序列中相邻

1705.吃苹果的最大数目

1 问题描述1705.吃苹果的最大数目 中等 There is a special kind of apple tree that grows apples every day for n days. On the ith day, the tree grows apples[i] apples that will rot after days[i] days, that is on day i + days[i] the apples will be rotten and cannot be eaten. On some days,

871.最低加油次数

1 问题描述871.最低加油次数 2 解题思路 2.1 动态规划对于这种有限次数,能看出来有递推关系的,可以考虑动态规划。 这里状态记为dp[i][j],表