We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99d368e commit e11d2baCopy full SHA for e11d2ba
src/main/java/com/fishercoder/solutions/_973.java
@@ -5,8 +5,8 @@
5
public class _973 {
6
7
public static class Solution1 {
8
- public int[][] kClosest(int[][] points, int K) {
9
- int[][] ans = new int[K][2];
+ public int[][] kClosest(int[][] points, int k) {
+ int[][] ans = new int[k][2];
10
11
PriorityQueue<int[]> pq = new PriorityQueue<>((o1, o2) -> {
12
double dist1 = getDistance(o1);
@@ -25,7 +25,7 @@ public int[][] kClosest(int[][] points, int K) {
25
pq.add(point);
26
}
27
28
- for (int i = 0; i < K; i++) {
+ for (int i = 0; i < k; i++) {
29
ans[i] = pq.poll();
30
31
0 commit comments