LeetCode 973. K Closest Points To Origin

Поделиться
HTML-код
  • Опубликовано: 8 окт 2024

Комментарии • 4

  • @SriramGopalGoli030792
    @SriramGopalGoli030792 4 года назад +1

    Its worth to note that priority queue in java does not strictly sort the values. It only sorts in a way that first element is the least and still have the rest of the elements unsorted.
    Also, practically speaking, slightly faster way would be to keep a min heap and add all points into it, then populate result with first k elements of min heap.

  • @harsha.m4026
    @harsha.m4026 4 года назад +3

    Please share the link to problem in the description. It helps.

  • @GurmeetSingh-yo4db
    @GurmeetSingh-yo4db 4 года назад +3

    Nyc tutotial on problem solving

  • @sben125
    @sben125 3 года назад +2

    does it matter the order of the array parameters in the overloaded compare method?