Skip to content

Commit 045ea0e

Browse files
committed
Create README - LeetHub
1 parent 55a4fd2 commit 045ea0e

File tree

1 file changed

+37
-0
lines changed
  • 2527-count-subarrays-with-fixed-bounds

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<h2><a href="https://leetcode.com/problems/count-subarrays-with-fixed-bounds">2527. Count Subarrays With Fixed Bounds</a></h2><h3>Hard</h3><hr><p>You are given an integer array <code>nums</code> and two integers <code>minK</code> and <code>maxK</code>.</p>
2+
3+
<p>A <strong>fixed-bound subarray</strong> of <code>nums</code> is a subarray that satisfies the following conditions:</p>
4+
5+
<ul>
6+
<li>The <strong>minimum</strong> value in the subarray is equal to <code>minK</code>.</li>
7+
<li>The <strong>maximum</strong> value in the subarray is equal to <code>maxK</code>.</li>
8+
</ul>
9+
10+
<p>Return <em>the <strong>number</strong> of fixed-bound subarrays</em>.</p>
11+
12+
<p>A <strong>subarray</strong> is a <strong>contiguous</strong> part of an array.</p>
13+
14+
<p>&nbsp;</p>
15+
<p><strong class="example">Example 1:</strong></p>
16+
17+
<pre>
18+
<strong>Input:</strong> nums = [1,3,5,2,7,5], minK = 1, maxK = 5
19+
<strong>Output:</strong> 2
20+
<strong>Explanation:</strong> The fixed-bound subarrays are [1,3,5] and [1,3,5,2].
21+
</pre>
22+
23+
<p><strong class="example">Example 2:</strong></p>
24+
25+
<pre>
26+
<strong>Input:</strong> nums = [1,1,1,1], minK = 1, maxK = 1
27+
<strong>Output:</strong> 10
28+
<strong>Explanation:</strong> Every subarray of nums is a fixed-bound subarray. There are 10 possible subarrays.
29+
</pre>
30+
31+
<p>&nbsp;</p>
32+
<p><strong>Constraints:</strong></p>
33+
34+
<ul>
35+
<li><code>2 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
36+
<li><code>1 &lt;= nums[i], minK, maxK &lt;= 10<sup>6</sup></code></li>
37+
</ul>

0 commit comments

Comments
 (0)