消息推送Leetcode每日一题 —— 3105. 最长的严格递增或递减子数组41分钟前Leetcode每日一题 —— 3105. 最长的严格递增或递减子数组🌐 链接: https://linux.do/t/topic/3158579🏷️ 分组: LinuxDo论坛🕒 时间: 2026-11-12 08:47:50 LINUX DO Leetcode每日一题 —— 3105. 最长的严格递增或递减子数组 思路 简单题简单做,直接模拟。 代码 class Solution { public int longestMonotonicSubarray(int[] nums) { int n = nums.length; int maxLen = 1; int incLen = 1; int decLen = 1; int last = nums[0]; for (int i = 1; i < n; i++)… 41分钟前