COFORGE Hiring Challenge | On Campus OA 2024 | Count Strictly Increasing Subarrays
Question · Posted Jun 2026
Problem Statement Given an integer array nums, count the total number of contiguous subarrays that are strictly increasing. A subarray is considered strictly increasing if every element is greater than its previous element. Return the total count of all strictly increasing subarrays, including single-element subarrays. Example 1 Input: nums = [1,3,5,4,4,6] Output: 10 Explanation: Strictly increasing subarrays are: [1] [3] [5] [4] [4] [6] [1,3] [3,5] [1,3,5] [4,6] Total = 10 Example 2 Input: nums = [1,2,3,4,5] Output: 15 Explanation: ...
The full answer & interview discussion are available to premium members.
Log in Create a free account