Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3ad4c45

Browse files
Sliding Window Maximum
1 parent 3d5464d commit 3ad4c45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎#5 - Queue/4-sliding-window-maximum.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Ques 4 : Sliding Window Maximum
22
// You are given an array of integers nums, there is a sliding window of size k which is
33
// moving from the very left of the array to the very right.You can only see the k numbers
4-
// in the window. Each time the sliding window moves right by one position.
4+
// in the window. Each time the sliding window moves right by one position. For each window,
5+
// take the maximum element and add them to a final result array.
56

67
// Input: nums = [1, 3, -1, -3, 5, 3, 6, 7], k = 3
78
// Output: [3, 3, 5, 5, 6, 7]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /