Find k-th smallest pair Distance | Leetcode hard | Interview Question

preview_player
Показать описание
In this video, we talk about the problem "Find k-th smallest pair Distance"

Комментарии
Автор

Hey,
Why do we return low and also why not simply return mid when we encounter a case where the no of pairs with difference <=mid is exactly equal to k because then surely, the k th smallest difference will be mid itself?

sharanpreetchadha
Автор

Time Complexity: O(nlogn)
Space Complexity: O(1)

samyakjain