Skip to content
SparkTime, home
Tag · 1 piece

#sliding window

Tagged #sliding window

GuideTechnology

18 min read

Sliding Window: Efficient Subarray and Substring Problems

Fixed-size and variable-size windows over arrays and strings, with running sums, counters and frequency maps. Learn the expand-and-shrink template, why it runs in O(n), and when negative numbers break it.