Search
⌘K
Get Premium
Leetcode 2875. Minimum Size Subarray in Infinite Array
Given a finite array repeated infinitely, find the length of the shortest contiguous subarray in that infinite periodic array whose sum equals target (or return -1). The core challenge is handling wrap‑around across repetitions and large targets efficiently, typically requiring prefix‑sum + residue/quotient reasoning to bound repeats and locate matching sums.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.