Leetcode 683. K Empty Slots
Given an array where flowers[i] is the position that blooms on day i+1, find the earliest day when there exist two bloomed flowers with exactly k unbloomed positions between them (i.e., two bloomed positions at distance k+1 and all intermediate flowers not yet bloomed), or return -1 if never possible. The core challenge is to convert between day/order and position and efficiently detect such pairs using windowing or ordered-data structures so checks across large n stay subquadratic.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.