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

Function getCount

javascript/0287-find-the-duplicate-number.js:48–56  ·  view source on GitHub ↗
(mid, nums, count = 0)

Source from the content-addressed store, hash-verified

46};
47
48const getCount = (mid, nums, count = 0) => {
49 for (const num of nums) {
50 /* Time O(N) */
51 const isMidGreater = num <= mid;
52 if (isMidGreater) count++;
53 }
54
55 return count;
56};
57
58/**
59 * https://leetcode.com/problems/find-the-duplicate-number/

Callers 1

findDuplicateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected