0% found this document useful (0 votes)
109 views6 pages

Sliding Window 2-Pointer

NA

Uploaded by

subodh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views6 pages

Sliding Window 2-Pointer

NA

Uploaded by

subodh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Sliding Window

&
2-Pointer Algorithm
Recent Interview Questions
Easy Problems

Sliding Window Minimum


You are given an array of n integers and an
integer k You have to select a window of k
contiguous elements from the array whose sum
is minimum.

Window String
Given two strings 's' and 't' containing characters
from a to z of lengths 'm' and 'n' respectively,
return the minimum window substring of 's' such
that every character in 't' (including duplicates) is
included in the window. If there is
no such substring, return the empty
string ""'.

Known for unique teaching and


immersive sessions turning
beginners into experts.

Manas Sir
Easy Problems

Make Files Equall


Given file1 and file2 of type string, you need to
print the modification made in file1 to get file2.
That if the element is removed from file1 to
make file2 you need to append the -ve sign
before it, If a new element is added in file1 to
make a file, you need to append the +ve sign
before it. (Similar to git diff)

Keep Practicing!
Solutions in Discussion Forum

With an ECE background from


IIIT-Hyd, he inspires non-CS
students entering Tech.

Swapnil Sir
Medium Problem

Painting Wall
Bob is painting a wall. The wall contains N Sections
and he has already painted some sections of the
wall randomly. The wall consists of a string of
length N containing lower-case alphabets 'a' to 'z'
denoting the color of the section. in 1 operation.
Bob can paint a single section of the wall to any
new colour.
He is now tired and does not want to do more than
k operations. So, he decides to create a
continuous segment of the wall which is
completely the same colour (a range [i, j] where all
wallſk] are equal, i <= K <= 1) What
is the maximum length of such a
segment he can Create?

Development curriculum
architect, he simplifies System
design expertise for learners.

Nalin Sir
Hard Problem

Max Min Subarrays


We have a number sequence A=[A1,A2,…,AN] =
[1​,2​,…,​] of length N and integers X and Y. Find
the number of pairs of integers (L,R) satisfying
all the following conditions :

1≤L≤R≤N
The maximum value of AL, AL+1, …, AR​, +1​,…,
is X, and the minimum is Y.

Passionate Competitive Coder


himself, Represented India in
ACM-ICPC World Finals

Kushagra Sir
Weekend Oriented
Job Switch Program

Avg. Salary Hike - 110%

Guarantee CTC 8 - 20LPA

Batch Starting in September

Join Now
Register here to get selected

An immersive bootcamp which builds your


coding skills & guarantees high paying tech
jobs.

You might also like