← ALL NOTES
Array

2110. Number of Smooth Descent Periods of a Stock

A smooth descent is a contiguous subarray where each price is exactly 1 less than the previous (a single element counts). Given prices, count all such subarrays. DP by the ending element: track the…

Loading…