>RunTimeFix
BookStudyPracticeInterviewsYouTubeCoursesAbout
Log inGet Started
Practice/Two Pointers & Sliding Window
4 subtopics · 17 problems

Two Pointers & Sliding Window

Linear-time scanning with two converging or co-moving pointers.

01Two Pointers — Opposite Direction

Left pointer moves right, right pointer moves left.

2 easy2 medium1 hard
ProblemDifficultyLink
6CAlice, Bob and ChocolateeasySolve
1850CWord on the PapereasySolve
1851DPrefix Permutation SumsmediumSolve
1462CUnique NumbermediumSolve
1904DSet To MaxhardSolve

02Two Pointers — Same Direction

Both pointers move forward; often used for merging or matching.

2 easy1 medium1 hard
ProblemDifficultyLink
279BBookseasySolve
1921CSending MessageseasySolve
1829DGold RushmediumSolve
1881FMinimum Maximum DistancehardSolve

03Sliding Window — Fixed Size

Maintain a window of size k and slide it across the array.

1 easy2 medium1 hard
ProblemDifficultyLink
1851BParity SorteasySolve
1862CFlower City FencemediumSolve
1352CK-th Not Divisible by nmediumSolve
1862EKolya and Movie TheatrehardSolve

04Sliding Window — Variable Size

Expand and shrink the window based on a condition.

2 medium2 hard
ProblemDifficultyLink
1873EBuilding an AquariummediumSolve
1843ETracking SegmentsmediumSolve
602BApproximating a Constant RangehardSolve
1886CIs It Flower?hardSolve
All TopicsStudy the Theory
Was this helpful?
>RunTimeFix

Practical programming education. Books, videos, courses, and hands-on learning for competitive programming, DSA, and software engineering.

RunTimeFix

  • About
  • YouTube
  • Book
  • Study Library
  • Courses

Learn

  • Competitive Programming
  • DSA
  • Development
  • Databases

Legal

  • Privacy
  • Terms
  • Refund Policy

RunTimeFix — debug → solve → run

© 2026 RunTimeFix. All rights reserved.