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
608
questions
-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 ...
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 &...
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 ...
-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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...