← 返回 goldmansachs 的题目列表Transaction Segments
类型:online_judge
Given an array transactionValues of length n, where transactionValues[i] represents the transaction amount at time i. Count the number of strictly increasing segments of length exactly k in the array. A strictly increasing segment is defined as transactionValues[i] < transactionValues[i+1] < ... < transactionValues[i+k-1], where each element must be greater than the previous one.
Example
Input
8
1 3 2 4 3 5 4 6
3