Skip to content

Commit 5ed92c4

Browse files
authored
Update README.md
1 parent 47f8c8c commit 5ed92c4

File tree

1 file changed

+7
-2
lines changed
  • Stacks And Queues/Sliding Window Maximum

1 file changed

+7
-2
lines changed

Stacks And Queues/Sliding Window Maximum/README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can only see the w numbers in the window. Each time the sliding window moves
77
rightwards by one position. You have to find the maximum for each window.
88

99
The following example will give you more clarity.
10-
10+
```
1111
The array A is [1 3 -1 -3 5 3 6 7], and B is 3.
1212
1313
Window position Max
@@ -23,17 +23,22 @@ Return an array C, where C[i] is the maximum value of from A[i] to A[i+B-1].
2323
Note: If B > length of the array, return 1 element with the max of the array.
2424
2525
26+
```
2627

2728

2829
Input Format
2930

3031
The first argument given is the integer array A.
32+
3133
The second argument given is the integer B.
34+
3235
Output Format
3336

37+
3438
Return an array C, where C[i] is the maximum value of from A[i] to A[i+B-1]
35-
For Example
3639

40+
For Example
41+
```
3742
Input 1:
3843
A = [1, 3, -1, -3, 5, 3, 6, 7]
3944
B = 3

0 commit comments

Comments
 (0)