Skip to content

Commit 966fb21

Browse files
refactor 239
1 parent dff0d0e commit 966fb21

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-2
lines changed

src/main/java/com/fishercoder/solutions/_239.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right.
99
* You can only see the k numbers in the window. Each time the sliding window moves right by one position.
1010
11-
For example,
11+
For example:
12+
1213
Given nums = [1,3,-1,-3,5,3,6,7], and k = 3.
1314
1415
Window position Max
@@ -28,7 +29,6 @@
2829
Could you solve it in linear time?
2930
3031
Hint:
31-
3232
How about using a data structure such as deque (double-ended queue)?
3333
The queue size need not be the same as the window’s size.
3434
Remove redundant elements and the queue should store only elements that need to be considered.

0 commit comments

Comments
 (0)