Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
66 views

I am working with irregular minute-level stock data in DolphinDB and need to implement a specific rolling calculation using the roll function which is new in version 3.00.4. I have a custom ...
HuaXian Tan's user avatar
1 vote
1 answer
112 views

The current problem I'm having is that when the code runs it shows me "None" in the terminal. /usr/local/bin/python3.12/Users/jaredmccarthy/Desktop/2025/ejercicios_leetcode.py None Process ...
Jared McCarthy's user avatar
1 vote
0 answers
54 views

I need to create an incremental window of 30 mins to show total number of events in that time frame in BigQuery. I am sharing a sample table and the desired output for the reference. The original ...
Deba's user avatar
  • 11
5 votes
4 answers
203 views

I have a Pandas dataframe: import pandas as pd import numpy as np np.random.seed(150) df = pd.DataFrame(np.random.randint(0, 10, size=(10, 2)), columns=['A', 'B']) I want to add a new column "C&...
Sun Jar's user avatar
  • 351
0 votes
1 answer
33 views

I am wondering whether it is possible to distinguish elements from offset time in Apache Flink sliding windows. Let me explain it in more details. I want to take elements from eg.: 13:00 to 13:59:59. ...
DamDev's user avatar
  • 125
0 votes
1 answer
72 views

I was trying to solve Leetcode 862. Shortest Subarray with Sum at Least K. My approach was to binary search on a sliding window. So I needed a method which checks for a given length sol, if there ...
Moosh's user avatar
  • 111
-1 votes
3 answers
133 views

I'm working on a Python problem where I need to check if an unsorted array contains any duplicates within a specified distance k. Specifically, I need to return True if any value appears more than ...
Pranav's user avatar
  • 1
-5 votes
1 answer
708 views

I'm trying to solve LeetCode 3: Longest Substring Without Repeating Characters. I'm implementing the Sliding Window method, which consists of using a left and a right pointer to contract and expand ...
tadm123's user avatar
  • 8,899
0 votes
0 answers
104 views

Doing the leetcode problem https://leetcode.com/problems/longest-substring-without-repeating-characters/ I found this solution: def lengthOfLongestSubstring(self, s: str) -> int: left = 0 ...
Javier Lázaro's user avatar
8 votes
3 answers
1k views

I am working with very large (several GB) 2-dimensional square NumPy arrays. Given an input array a, for each element, I would like to find the direction of its largest adjacent neighbor. I am using ...
DanDan面's user avatar
  • 191
-1 votes
2 answers
743 views

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
98 views

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
141 views

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
2 answers
2k views

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
142 views

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
30 views

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
74 views

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
137 views

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
199 views

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
197 views

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
56 views

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
153 views

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
  • 242
0 votes
2 answers
480 views

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
630 views

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
  • 101
0 votes
1 answer
150 views

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
  • 101
0 votes
1 answer
1k views

So I attempted this leetcode problem and I was able to come up with a solution that passes 1017/1026 test cases. The remaining that failed did so due to the time limit exceeding and not incorrectness ...
Duck Dodgers's user avatar
0 votes
1 answer
80 views

parent for loop has On , while loop has amoritised O n? meaning we consider it O 1? also min and max operations they will be O k but again On in worst case? is it O (n^3) ? left=0 ...
faber soaks's user avatar
2 votes
1 answer
89 views

Problem 2653. Sliding Subarray Beauty Given an integer array nums containing n integers, find the beauty of each subarray of size k. The beauty of a subarray is the xth smallest integer in the ...
Karina's user avatar
  • 101
1 vote
1 answer
111 views

I'm experimenting with 1D time-series data and trying to reproduce the following approach via animation over my own data in GoogleColab notebook. I faced the problem of re-producing animation from ...
Mario's user avatar
  • 2,094
0 votes
1 answer
77 views

Problem You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. ...
Karina's user avatar
  • 101
-1 votes
2 answers
149 views

I'm trying to solve LeetCode problem 1461. Check If a String Contains All Binary Codes of Size K: Given a binary string s and an integer k, return true if every binary code of length k is a substring ...
Karina's user avatar
  • 101
0 votes
1 answer
97 views

I use python stumpy to extract subsequences from a timeseries. For a pattern Q and a timeseries T, I use the function stumpy.match https://stumpy.readthedocs.io/en/latest/api.html#stumpy.match Now ...
doog_math's user avatar
0 votes
1 answer
122 views

Problem Given a binary array nums and an integer goal, return the number of non-empty subarrays with a sum goal. Link to the problem Code class Solution: def numSubarraysWithSum(self, nums, goal): ...
Karina's user avatar
  • 101
0 votes
1 answer
102 views

Problem You've given an integer array nums and integer k. Find the maximum subarray sum of all the subarraay of nums that meet the following conditions. The length of the subarray is k, and All the ...
Karina's user avatar
  • 101
1 vote
1 answer
192 views

Problem Given an array of positive integers nums and a positive integer target, return minimal length of subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 ...
Karina's user avatar
  • 101
1 vote
1 answer
149 views

I'm trying to solve LeetCode problem 1493. Longest Subarray of 1's After Deleting One Element: Given a binary array nums, you should delete one element from it. Return the size of the longest non-...
Karina's user avatar
  • 101
0 votes
2 answers
457 views

Can be repetitive, but I couldn't find exact one. This is the part of a problem involving Data Structure and Algotrithms: Given an array of size n, find max frequency among the all elements in the ...
Ashutosh Rana's user avatar
-3 votes
1 answer
119 views

I'm looking at the below solution, and spent hours and hours trying to understand why it works but couldn't figure it out. Assuming my understanding is correct that f1 stores the max length of ...
bubu's user avatar
  • 85
1 vote
0 answers
76 views

I'm tackling a challenging problem and seeking assistance to find a solution with linear time complexity (Theta(n)). The objective is to compute the maximum strength a creature can harness from a ...
Lukáš Kocián's user avatar
1 vote
1 answer
143 views

i am currenty using MATLAB Deep Learning Toolbox to build a LSTM-Network to do timeseries regression. Since my data has 12 features and 1 response. The input size of the sequenceInputLayer is set to ...
Xinyi Wang's user avatar
0 votes
1 answer
45 views

enter image description here Problem link: https://www.geeksforgeeks.org/problems/smallest-window-containing-0-1-and-2--170637/1 Getting TLE after using the sliding window technique that takes O(N) ...
Nazim Qureshi's user avatar
1 vote
1 answer
132 views

I need to get several sliding windows from an image using the Julia programming language. I am newcomer to the language and having a hard-time finding a performant solution. The problem: Lets say I ...
Siddharth Yadav's user avatar
0 votes
0 answers
102 views

I have several covariate layers that vary in resolution I would like to run sliding window analyses on all of these layers with a window size of 800m. This window size is important to maintain exactly ...
madip's user avatar
  • 15
-1 votes
1 answer
61 views

I need a function that selects all the data from a 2D array in a square window but I want to do this in Python. Is there any specific function for it? median_x_array = median_coords_3d_array[:, :, 0] ...
HBM's user avatar
  • 1
0 votes
0 answers
90 views

This is a snippet from this code to finding sums of all subarrays of a given array, but this doesn't work as intended as the problem seems to be lying with pre-incrementing value of i in the equation. ...
Pradyuman Sharma's user avatar
-1 votes
1 answer
140 views

I have an odd length window and a array and I need to find the index of the array where the window is centered and matches more. So far I am doing it with the following code. Is it possible to speed ...
Thoth's user avatar
  • 1,041
0 votes
1 answer
665 views

This is a Leetcode problem, You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is equal to k that has the maximum average value and ...
Bhoomika's user avatar
0 votes
1 answer
113 views

Here is a visual of what I want to have happen 5 bit sliding window In words, I want a sliding window of 5 bits. I need to store a history of 5 events within a single byte. I'm using the 5 most ...
crose72's user avatar
0 votes
1 answer
109 views

I'm experimenting with 1D time-series data and trying to reproduce the following approach via animation over my own data in GoogleColab notebook. It's about reproducing the animation of this approach: ...
Mario's user avatar
  • 2,094
2 votes
1 answer
378 views

I'm trying to solve Leetcode 424. Longest Repeating Character Replacement. Why is this code not working, I cannot get my head around it. class Solution: def characterReplacement(self, s: str, k: ...
user123's user avatar
  • 307

1
2 3 4 5
13