
[LeetCode] 3105. Longest Strictly Increasing or Strictly Decreasing Subarray (Python)
·
알고리즘/LeetCode
난이도: Easy문제 설명You are given an array of integers nums. Return the length of the longest subarray of nums which is either strictly increasing or strictly decreasing. 문제 예제Example 1:Input: nums = [1,4,3,3,2]Output: 2Explanation:The strictly increasing subarrays of nums are [1], [2], [3], [3], [4], and [1,4].The strictly decreasing subarrays of nums are [1], [2], [3], [3], [4], [3,2], and [4,3].Hen..