Count Subarrays Matching a Comparison Pattern

Company: Susquehanna_15sep

Difficulty: medium