MCPcopy 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
21const squaredDistance = ([x, y]) => x ** 2 + y ** 2;
22
23//////////////////////////////////////////////////////////////////////////////
24// Max Heap or Max Priority Queue

Callers 2

kClosestFunction · 0.85
partitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected