MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / carFleet

Function carFleet

javascript/0853-car-fleet.js:9–17  ·  view source on GitHub ↗
(target, position, speed)

Source from the content-addressed store, hash-verified

7 * @return {number}
8 */
9var carFleet = function (target, position, speed) {
10 const coordinates = getCoordinates(
11 target,
12 position,
13 speed,
14 ); /* Time O(N * log(N)) | Space O(N) */
15
16 return searchAscending(coordinates); /* Time O(N) | Space O(N) */
17};
18
19var getCoordinates = (target, position, speed) =>
20 position

Callers

nothing calls this directly

Calls 3

getCoordinatesFunction · 0.85
searchAscendingFunction · 0.85
searchDescendingFunction · 0.85

Tested by

no test coverage detected