Question
A price dashboard highlights the longest rally: the longest stretch of consecutive days where each day's price is strictly higher than the previous day's. Given the daily prices in order, return the length of that stretch. A single day counts as a stretch of length 1; an empty history returns 0. Example: [1, 2, 3, 1, 4, 5, 6, 7] returns 5 (the run 1, 4, 5, 6, 7).
longest_rally(prices: list[int]) → int[[1,2,3,1,4,5,6,7]]out5State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.