Bridge Water Assoc OA | Number of Strinctly Increasing Subarrays of size k in an Array |
Anonymous User
7653

Question : Count the number of strictly increasing subarray of a specified size k in an array of size N .

Eg: Array= [ 5,3,5,7,8] and k=3 , The answer is 2 as [3,5,7] and [5,7,8] are the answer.

I tried applying Sliding Window Technique but could not come up with an optimal solution . I fixed the window size and checked all the elements in window one by one . This is a brute force solution . How do I optimise this as I got TLE in the last 3 Hidden Test Cases.

Any input is helpful

Comments (12)