Skip to content

Commit 8b23833

Browse files
authored
Update Solution.py
1 parent 845cf47 commit 8b23833

File tree

1 file changed

+1
-1
lines changed
  • solution/0900-0999/0973.K Closest Points to Origin

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
class Solution:
22
def kClosest(self, points: List[List[int]], k: int) -> List[List[int]]:
3-
points.sort(key=lambda p: p[0] * p[0] + p[1] * p[1])
3+
points.sort(key=lambda p: hypot(p[0], p[1]))
44
return points[:k]

0 commit comments

Comments
 (0)