Skip to content

Instantly share code, notes, and snippets.

View iemeka's full-sized avatar
🎯
Focusing

Emeka iemeka

🎯
Focusing
View GitHub Profile
@iemeka
iemeka / sliding window
Last active September 2, 2021 21:24
sliding window of any length.
let left = 0;
let right = 0;
let windowLength = 3;
let s = "abcdefghijklmnopqrstuv";
while(right < s.length){
if (left+windowLength-1>right){
console.log(s.substring(left,right+1))
right++;
}else{