xinyu04

导航

2022年5月24日 #

LeetCode 845 Longest Mountain in Array 正向DP+反向DP

摘要: You may recall that an array arr is a mountain array if and only if: arr.length >= 3 There exists some index i (0-indexed) with 0 < i < arr.length - 1 阅读全文

posted @ 2022-05-24 22:30 Blackzxy 阅读(15) 评论(0) 推荐(0) 编辑

LeetCode 1218 Longest Arithmetic Subsequence of Given Difference 哈希表HashMap

摘要: Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that th 阅读全文

posted @ 2022-05-24 00:09 Blackzxy 阅读(10) 评论(0) 推荐(0) 编辑