Available question text
Count how many contiguous subarrays of length m+1 in nums have adjacent pairs that match a given pattern of -1/0/1 (interpreted as <, ==, > respectively). In other words, for each window check that sign(nums[i+k+1] − nums[i+k]) equals pattern[k] for all k.
Related questions
Continue with questions that share topics or the same question type.
- Number of Subarrays That Match a Pattern II
Coding
- Count Number of Nice Subarrays
Coding · Array · Hash Table · Math
- Count the Digits That Divide a Number
Coding
- Count the Number of Beautiful Subarrays
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3034. Number of Subarrays That Match a Pattern I
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source