Sunday common C++ interview problem: Bounded subarrays
Given an array of integers and two boundary values, A and B, return the number of (contiguous) subarrays for which the value A is the minimum and value B is the maximum of the subarray.
Solve it yourself: https://compiler-explorer.com/z/6d84jE5c9
Solution: https://compiler-explorer.com/z/6EraMz1E1