Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ squaredDistance
Function
squaredDistance
javascript/0973-k-closest-points-to-origin.js:21–21 ·
view source on GitHub ↗
([x, y])
Source
from the content-addressed store, hash-verified
19
20
// Calculate and return the squared Euclidean distance
21
const
squaredDistance = ([x, y]) => x ** 2 + y ** 2;
22
23
//////////////////////////////////////////////////////////////////////////////
24
// Max Heap or Max Priority Queue
Callers
2
kClosest
Function · 0.85
partition
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected