Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [sliding-window]

In data analysis, sliding windows are advancing sub-lists inside lists which allow, e.g., computation of a record's change from the previous record or next record. In networking, a sliding window may refer to a flow control technique that maintains windows of sequential frames sent or received without a corresponding acknowledgement.

sliding-window
-1 votes
2 answers
96 views

Flip consecutive zeroes to ones in k operations to have maximum number of ones, find the maximum number of ones

You are given a binary string made of 0 and 1, and a value k which represents number of operations. You can flip consecutive 0s in each operation to 1s. Find the maximum number of 1s after k ...
bugdebug's user avatar
2 votes
1 answer
29 views

Longest Repeating Substring With Replacement

Working on an online practice problem and ran into an issue that I can't seem to figure out. I am looking to find the longest length of a string of characters whose characters can only be replaced &...
EdAlex's user avatar
  • 45
1 vote
1 answer
95 views

Why does the sliding window algorithm not work for this problem statement?

The question is regarding an algorithm which I'm using to solve a problem. The problem statement is: (or view it here) "Given arrival and departure times of all trains that reach a railway ...
BlazeRod11's user avatar
-1 votes
1 answer
331 views

Length of Longest Subarray With A Consistent Frequency

Given an array A, a subarray of A is called "consistent" if the maximum occurrence of all elements in the subarray is equal to the minimum occurrence of all elements in the subarray. Find ...
Emmanuel Pierre's user avatar
1 vote
4 answers
81 views

The minimum size of substrings for the presence of at least one character

i have a question that want the minimum length of k that in each consecutive substring of a string with length k, There must be at least one common character. for example if s="abcaca" for k ...
Amir Hossein's user avatar
0 votes
0 answers
18 views

Difference in desktop site & mobile site's view of sliding gallery

I've been trying to get this thing to work for a while now, but it's been giving me headaches. (Not an experienced coder here), But i was able to add a sliding gallery to my site : https://www....
Khaleel Haynesworth's user avatar
0 votes
0 answers
35 views

Cold data migration with sliding window stored procedure for partitioned tables in SQL Server

I am trying to write a sliding window stored procedure in SQL Server in order to migrate cold data to a cold storage. To do this, I planned on creating an "Archiving" table, that will store ...
Felipe Vallim's user avatar
1 vote
1 answer
40 views

Calculating percentile over a sliding window in Power Query

I have a table with 5 columns, District (type text), Month Cumulative (Int64.Type), Measurement (type text), Value (type number) and Monthdate (type Date, 1/mm/yyyy). The table is sorted on District ...
Sarcastix's user avatar
0 votes
4 answers
161 views

Find substrings that contain a certain amount of certain characters

I have a string like GGACATCGCGGTGGATCGAC. How can I find all substrings that contain, for example, three Gs in any order? For this string, it would be GCGG or GTGG, or GGACATCG. Also need to find ...
Diana's user avatar
  • 101
1 vote
1 answer
51 views

Time Complexity of Inner Loop of sliding window algorithm

I am looking at a LeetCode problem 1838. Frequency of the Most Frequent Element: The frequency of an element is the number of times it occurs in an array. You are given an integer array nums and an ...
enigma312's user avatar
0 votes
0 answers
26 views

Count With K Different Characters

The problem is basically to count the number of substrings with exactly k distinct characters.There can be duplicate as long as there are k distinct characters. I was trying sliding window method in ...
Udit Raj Vashisth's user avatar
0 votes
1 answer
137 views

Check if this code uses a data sliding window

I want help to check if the following code (from https://github.com/jsh4887/ConvLSTM/blob/main/1.%20Make_dataset.py): import os import numpy as np import pandas as pd import pickle from sklearn....
Marco's user avatar
  • 211
0 votes
2 answers
158 views

Sliding window Minimum Size Subarray Sum

Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 ...
Rohith Amaz's user avatar
1 vote
2 answers
421 views

Count Subarrays Where Max Element Appears at Least K Times sliding window

Problem Count Subarrays Where Max Element Appears at Least K Times You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums ...
Karina's user avatar
  • 103
0 votes
1 answer
98 views

Minimum window substring not sliding correctly

Problem Minimum Window Substring Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included ...
Karina's user avatar
  • 103

15 30 50 per page
1
2 3 4 5
41