Longest Increasing Streak (Set 2)

Medium

Given an array of integers nums, return the length of the longest run of strictly increasing neighbouring values.

An empty array scores 0; every element counts as a streak of 1.

Longest Increasing Streak (Set 2) — the data. This set runs 4 cases: nums holds arrays of 6–14 items, with values from 1 to 8. The hidden cases are the largest of the set.

Example 1

longestIncreasingStreak()
Input
nums = [6, 5, 6, 8, 3, 3]
Output
3

Why

`longestIncreasingStreak` returns `3` for this input.

Example 2

longestIncreasingStreak()
Input
nums = [8, 8, 4, 4, 5, 7, 5, 3, 6, 7]
Output
3

Why

`longestIncreasingStreak` returns `3` for this input.
Constraints
0 <= nums.length <= 10^5
-10^4 <= nums[i] <= 10^4
Every case in this set must pass: the first two are visible on Run, the last two unlock on Submit.

Topics

ArraysSimulation

Implement longestIncreasingStreak in the editor and return the answer — printing it is never graded.