piyushsharma220699 / LeetCode-Problems-Solution-Book

REPOSITORY EXCLUDED FROM HACKTOBERFEST 2021, CHECK THIS : https://github.com/piyushsharma220699/Hacktoberfest-2021/issues/261
https://hacktoberfest.digitalocean.com/
MIT License
37 stars 98 forks source link

239. Sliding Window Maximum #172

Open Samridhi-98 opened 2 years ago

Samridhi-98 commented 2 years ago

239. Sliding Window Maximum

You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.

Return the max sliding window.

Input: nums = [1,3,-1,-3,5,3,6,7], k = 3
Output: [3,3,5,5,6,7]
Explanation: 
Window position                Max
---------------               -----
[1  3  -1] -3  5  3  6  7       3
 1 [3  -1  -3] 5  3  6  7       3
 1  3 [-1  -3  5] 3  6  7       5
 1  3  -1 [-3  5  3] 6  7       5
 1  3  -1  -3 [5  3  6] 7       6
 1  3  -1  -3  5 [3  6  7]      7
Samridhi-98 commented 2 years ago

@piyushsharma220699 I want to solve this in C++, Kindly assign this issue to me as a part of hacktoberfest-2021

piyushsharma220699 commented 2 years ago

@Samridhi-98 Assigned in C++

anupamdey2001 commented 2 years ago

@piyushsharma220699 I want to solve this in Java please assign me this issue

piyushsharma220699 commented 2 years ago

@anupamdey2001 I'll assign this to you in Java, but now this repo has been excluded from Hacktoberfest 2021, please read the pinned issue of this repo to know more :')

snehashukkla commented 2 years ago

@piyushsharma220699 please assign this to me in C++