Quant Memo
Coding/●●●●

Longest streak of rising prices

Given a series of closing prices, find the length of the longest stretch where each price is strictly greater than the one before it.

prices = [4, 5, 6, 3, 4], k = ignored
-> 3            # the run 4, 5, 6

Return the length of the longest strictly increasing run of consecutive prices. Aim for O(n)O(n).

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions