Search
⌘K

Leetcode 3161. Block Placement Queries

Support inserting obstacles at points on the nonnegative number line and, for each query, determine whether there exists any obstacle-free interval of length >= sz fully inside [0, x] (touching obstacles is allowed). Algorithmically this reduces to maintaining an ordered set of obstacle positions and checking if the maximum consecutive gap within [0, x] is at least sz.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.