Search
⌘K

Leetcode 3275. K-th Nearest Obstacle Queries

Given a stream of point insertions on an infinite plane, after each insertion return the k-th smallest Manhattan distance (|x|+|y|) from the origin or -1 if fewer than k points exist. The core challenge is to maintain the k-th order statistic of distances under insert-only updates efficiently (e.g., with a size-k heap or other order-statistic structure) for up to 2e5 queries.


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.